You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Output (huffc -r ./test-empty.huff):50 (Equivalent to compiling just pop)
Expected Output: Compiler Error indicating that the referenced macro parameter <b> in LE_MACRO is undefined
Description
If a macro parameter is missing / undefined the current compiler will simply skip it, potentially resulting in invalid bytecode. This particularly becomes an issue when you're e.g. refactoring larger files where it may be hard to notice whether or not you forgot to add a certain parameter. Furthermore, I can imagine few situations where you'd want macro arguments to be optional as they'll modify the stack and meaning of subsequent instructions.
Huff version: huffc 0.3.2 (nightly: 813b6b6)
Reproducing
Example 1
Output (
huffc -r ./test-empty.huff):80(Equivalent to compiling justdup1)Expected Output: Compiler Error indicating that
LE_MACROis missing it's parameteraat the specific line inMAINExample 2
Output (
huffc -r ./test-empty.huff):50(Equivalent to compiling justpop)Expected Output: Compiler Error indicating that the referenced macro parameter
<b>inLE_MACROis undefinedDescription
If a macro parameter is missing / undefined the current compiler will simply skip it, potentially resulting in invalid bytecode. This particularly becomes an issue when you're e.g. refactoring larger files where it may be hard to notice whether or not you forgot to add a certain parameter. Furthermore, I can imagine few situations where you'd want macro arguments to be optional as they'll modify the stack and meaning of subsequent instructions.