Skip to content

Commit

Permalink
Fix invalid pfb string in r2svd when the bitstruct have 0 fields
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Oct 31, 2024
1 parent 3596e7f commit 49a9165
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions r2svd/r2svd.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ def print_comment(msg, addr):
nam = f"{nam} {fname}"
fmt = f"{fmt}{wi}b"
# TODO. bit offset ignored. we are assuming fields are sorted properly
print_bitfield(at, bfsize, f"{fmt}{nam}")
fmt=""
nam=""
if fmt != "":
print_bitfield(at, bfsize, f"{fmt}{nam}")
fmt = ""
nam = ""

# print(json.dumps(svd_dict, sort_keys=True, indent=4, separators=(',', ': ')))

0 comments on commit 49a9165

Please sign in to comment.