Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid C13 inlinee line length #81

Merged
merged 1 commit into from
Mar 18, 2020

Conversation

jan-auer
Copy link
Member

@jan-auer jan-auer commented Mar 17, 2020

Fixes computation of the code length of inlinee line records if they are not declared explicitly in binary annotations.

In many cases, binary annotations set the code length explicitly using opcodes like ChangeCodeLengthAndCodeOffset. In some cases, however, the compiler only advances the code offset using ChangeCodeOffsetAndLineOffset. In this case, the code length should be inferred by the difference from the last line record.

The initial implementation wrongly subtracted the code offset base instead of the last offset. In this patch, the last offset is correctly subtracted.

Fixes #78

@jan-auer
Copy link
Member Author

This fix is not yet verified as I'm lacking a proper test case at the moment.

@jrmuizel
Copy link
Collaborator

I verified that this fix does work for me.

@jan-auer jan-auer requested a review from willglynn March 17, 2020 22:02
@jan-auer
Copy link
Member Author

Added a test case based on the file provided by @mstange and verified manually. This should be ready now.

@jan-auer jan-auer force-pushed the fix/invalide-inlinee-line-length branch from 0c4ebe2 to fce3a55 Compare March 17, 2020 22:17
@jan-auer jan-auer force-pushed the fix/invalide-inlinee-line-length branch from fce3a55 to 1bf1d54 Compare March 17, 2020 22:47
@jan-auer jan-auer merged commit 0e62461 into master Mar 18, 2020
@jan-auer jan-auer deleted the fix/invalide-inlinee-line-length branch March 18, 2020 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad lengths are returned by C13InlineeLineIterator
2 participants