summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-05-27 02:19:43 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-05-27 02:19:43 +0000
commit24762d487c30cdf7f0760356ce85a689afcbcaac (patch)
tree91f69bae93f37a8ee93f9edf0d4d8547097bb50b
parentd4bc3f54ecf1a962bb1b2f270690ba35c2de8c96 (diff)
downloadnasm-24762d487c30cdf7f0760356ce85a689afcbcaac.tar.gz
Correct handling of SEG <nonsegment>; per BR 560575
-rw-r--r--eval.c2
-rw-r--r--test/br560575.asm6
2 files changed, 8 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 72bb4d03..28aca642 100644
--- a/eval.c
+++ b/eval.c
@@ -655,6 +655,8 @@ static expr *expr6(int critical)
if (!e)
return NULL;
e = segment_part(e);
+ if (!e)
+ return NULL;
if (is_unknown(e) && critical) {
error(ERR_NONFATAL, "unable to determine segment base");
return NULL;
diff --git a/test/br560575.asm b/test/br560575.asm
new file mode 100644
index 00000000..8e02ddd2
--- /dev/null
+++ b/test/br560575.asm
@@ -0,0 +1,6 @@
+;
+; Test for bug report 560575
+;
+ dw seg ~1
+ dw seg "a"
+ dw seg 'a'