mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 18:52:07 +00:00
Fix condition for assuming at EOF
Part of that condition's purpose is to ensure that we read the correct lexer state; but it's possible now for the fstack to be non-empty *before* the lexer state is registered, i.e. if there is an error in the function that registers it. This causes a NULL pointer deref.
This commit is contained in:
1
test/asm/nonexist-include.asm
Normal file
1
test/asm/nonexist-include.asm
Normal file
@@ -0,0 +1 @@
|
||||
INCLUDE "nonexist-include.inc"
|
||||
3
test/asm/nonexist-include.err
Normal file
3
test/asm/nonexist-include.err
Normal file
@@ -0,0 +1,3 @@
|
||||
error: nonexist-include.asm(1):
|
||||
Unable to open included file 'nonexist-include.inc': No such file or directory
|
||||
error: Assembly aborted (1 error)!
|
||||
4
test/asm/notexist.err
Normal file
4
test/asm/notexist.err
Normal file
@@ -0,0 +1,4 @@
|
||||
error: at top level:
|
||||
Failed to stat file "notexist.asm": No such file or directory
|
||||
FATAL: at top level:
|
||||
Failed to open main file
|
||||
@@ -60,13 +60,13 @@ else
|
||||
rm -f version.asm
|
||||
fi
|
||||
|
||||
for i in *.asm; do
|
||||
for i in *.asm notexist.asm; do
|
||||
flags=${i%.asm}.flags
|
||||
RGBASMFLAGS=-Weverything
|
||||
if [ -f "$flags" ]; then
|
||||
RGBASMFLAGS="$(head -n 1 "$flags")" # Allow other lines to serve as comments
|
||||
fi
|
||||
for variant in '' '.pipe'; do
|
||||
for variant in '' ' piped'; do
|
||||
(( tests++ ))
|
||||
echo "${bold}${green}${i%.asm}${variant}...${rescolors}${resbold}"
|
||||
if [ -e "${i%.asm}.out" ]; then
|
||||
@@ -85,8 +85,9 @@ for i in *.asm; do
|
||||
desired_errput=$desired_errname
|
||||
else
|
||||
# `include-recursion.asm` refers to its own name inside the test code.
|
||||
# Skip testing with stdin input for that file.
|
||||
if [ "$i" = "include-recursion.asm" ]; then
|
||||
# "notexist" doesn't exist, so there's no point in trying to `cat` it.
|
||||
# Skip testing with stdin input for those file.
|
||||
if [[ "$i" = include-recursion.asm || "$i" = notexist.asm ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user