diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-09-29 12:06:28 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-09-29 17:44:50 -0700 |
commit | ef79039287b7a76f4fcb0628a6295582d8caf768 (patch) | |
tree | 15cccf34d0a8a451c95e16bb8ae05e2e389d4fd1 /subx/032check_operand_bounds.cc | |
parent | 8fb01417031f2c6eaa8af505112ed1bb1a51ea21 (diff) | |
download | mu-ef79039287b7a76f4fcb0628a6295582d8caf768.tar.gz |
4616 - fix subx/examples/ex7
It was broken since I added support for global variables, back on Sep 1. One other subtle thing I've improved is the name `looks_like_hex_int`. We can now distinguish in the pack-operands transform between ignoring 'foo' because it doesn't look like a number, and immediately flagging '0xfoo' as an error because it *should* be a number.
Diffstat (limited to 'subx/032check_operand_bounds.cc')
-rw-r--r-- | subx/032check_operand_bounds.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/subx/032check_operand_bounds.cc b/subx/032check_operand_bounds.cc index 69daeb46..966913e9 100644 --- a/subx/032check_operand_bounds.cc +++ b/subx/032check_operand_bounds.cc @@ -39,7 +39,7 @@ void check_operand_bounds(const segment& code) { void check_operand_bounds(const word& w) { for (map<string, uint32_t>::iterator p = Operand_bound.begin(); p != Operand_bound.end(); ++p) { if (!has_operand_metadata(w, p->first)) continue; - if (!is_hex_int(w.data)) continue; // later transforms are on their own to do their own bounds checking + if (!looks_like_hex_int(w.data)) continue; // later transforms are on their own to do their own bounds checking int32_t x = parse_int(w.data); if (x >= 0) { if (static_cast<uint32_t>(x) >= p->second) |