Commit aa0e3dd
Fix off-by-one in Stack::push() and Stack::pushZeroes() boundary checks (#5015)
Change strict less-than (<) to less-than-or-equal (<=) in the
FW_ASSERT guards of Stack::push<T>() and Stack::pushZeroes(), matching
the existing Stack::push(U8*, StackSizeType) overload.
The old strict check rejected exact-fit growth (size + growth ==
MAX_STACK_SIZE) with a hard assertion, even though the directive
handlers (ALLOCATE, CALL, etc.) correctly allow it. This mismatch
let validated sequences abort the process at runtime instead of
returning a handled STACK_OVERFLOW error.
Fixes #5008
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>1 parent 9cf0ad0 commit aa0e3dd
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
0 commit comments