ljd
ljd copied to clipboard
Insert instruction fails
Following code fails for some files (state.debuginfo.addr_to_line_map
is empty, so index our of bounds exception is thrown):
https://github.com/Aussiemon/ljd/blob/2ed0381b2e563531b0fe8de0a574cea8e6a04478/ljd/ast/builder.py#L1265
My workaround was
line_mapping = -1
if preceding_index >= 0 and preceding_index < len(state.debuginfo.addr_to_line_map):
line_mapping = state.debuginfo.addr_to_line_map[preceding_index]
Not sure if it's a good or bad fix, but it does work.