-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(parser): fix potential overflows when parsing hexadecimal values (#…
…608) * test: add unit tests for immediate parsing * doc: improve immediate param types doc Also remove unnecessary computation of a well-known value. * doc(parser): document immediate bounds * test(parser): test immediates starting with # * doc: document use of the # character. * refactor: remove unnecessary increments This makes it easier to move the logic to a separate method. * refactor: unify unsigned immediate parsing * add a method to parse immediate values; * add unit tests; * use the method in the parsing of unsigned immediates; * unify the code to parse %U and %C. * refactor(parser): remove broken feature Removes the ability to do arithmetic when loading memory labels as immediate values (e.g., daddi r1, r0, label+20). This feature is undocumented and has been broken since the very first release (there is a bug where the entire token "label+operand" is parsed as an integer). As part of the removal, add back an overflow check for the label address, which makes a test correctly fail at parsing time rather than at runtime, therefore change the expected exception in tests. * refactor: clean up %I parsing * use parseImmediate(); * remove unused (and problematic) Converter functions; * update docs to mention the ability to use memory labels as immediates. Fixes #450. * refactor: move parseImmediate to Converter
- Loading branch information
Showing
10 changed files
with
189 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.