dbrotz
74e9de1b71
Check for RPN stack overflow in linker
2019-07-04 16:49:23 -07:00
dbrotz
015d2b0830
Fix buffer overflow when creating patches with long RPN expressions
...
The createpatch() function was using a fixed-size buffer. I've changed it
to be dynamically allocated. I saw that the RPN format used in patches is
slightly different from the one used internally in the assembler, so I
added a new member to the Expression struct to track the patch size.
I've also limited the RPN expression length to 1MB. I realized that the
patch RPN expression could potentially be longer than the internal RPN
expression, so the internal expression would need a limit smaller than
UINT32_MAX. I thought 1MB would be a reasonable limit.
2019-07-04 16:49:09 -07:00
dbrotz
975f85260d
Use code points instead of bytes for STRSUB/STRLEN
2019-06-02 16:10:34 -07:00
dbrotz
f29d768989
Set all of expr struct's fields in mergetwoexpressions()
2019-05-31 08:59:50 -07:00
dbrotz
b909a5063a
Include symbol name in 'symbol too long' error message
2019-05-29 10:56:59 -07:00
dbrotz
e12e7b2acc
Don't assign PC to macro symbols
...
Macros have nothing to do with the current PC, so this doesn't make any sense.
The value isn't ever used either.
2019-05-09 15:01:06 -07:00
dbrotz
f927c41abb
Add test for referencing a symbol before setting it
2019-05-09 14:46:11 -07:00
dbrotz
249acace08
Prevent non-reloc symbol from shadowing reloc symbol
2019-05-09 12:48:10 -07:00
dbrotz
021990b8e0
Properly check if a symbol's full name is too long
2019-05-05 20:21:55 -07:00
dbrotz
540564694c
Add missing space to error message
2019-05-05 18:13:10 -07:00
dbrotz
8da4feb83c
Use sym_FindSymbol() where possible
2019-05-05 18:10:05 -07:00
dbrotz
23f5e9dacc
Use only one pass
2019-05-05 15:50:56 -07:00
dbrotz
40006c6152
Make yylex() return int
2019-05-02 19:53:45 -07:00
dbrotz
b256e4c2e3
Dynamically allocate RPN expression buffer
2019-05-02 19:31:26 -07:00
dbrotz
5a3c12cc6b
Add test for file ending with \
2018-12-06 23:27:41 -08:00
dbrotz
a05fd9b818
Print full file path in error messages
2018-12-06 22:59:24 -08:00
dbrotz
6c1ec59a5b
Use separate function to append newlines
2018-12-05 01:32:06 -08:00
dbrotz
a060f135b8
Only add newlines to file if necessary
2018-12-02 20:43:20 -08:00
dbrotz
f5d3087e9b
Check if integer constants only contain radix prefix
2018-12-02 16:16:41 -08:00
dbrotz
2795404cd7
Add myself to contributors
2018-12-02 16:01:08 -08:00
dbrotz
3806eb3139
Fix ambiguity in const parsing
2018-12-02 13:49:12 -08:00
dbrotz
bad66e54fa
Fix buffer overflow when file ends with \
2018-12-01 07:21:25 -08:00