summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gas/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/gas/expr.c')
-rw-r--r--gnu/usr.bin/gas/expr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gnu/usr.bin/gas/expr.c b/gnu/usr.bin/gas/expr.c
index fa62c23274a..5926b528b32 100644
--- a/gnu/usr.bin/gas/expr.c
+++ b/gnu/usr.bin/gas/expr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expr.c,v 1.5 1998/02/17 12:44:16 deraadt Exp $ */
+/* $OpenBSD: expr.c,v 1.6 1998/11/16 00:52:32 jason Exp $ */
/* expr.c -operands, expressions-
Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: expr.c,v 1.5 1998/02/17 12:44:16 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: expr.c,v 1.6 1998/11/16 00:52:32 jason Exp $";
#endif
#include <ctype.h>
@@ -847,7 +847,9 @@ segT expr(rank, resultP)
* expression is given the segment of right expression (always a DIFFERENCE,
* which should get resolved by fixup_segment())
*/
- if (resultP->X_got_symbol) {
+ if (resultP->X_got_symbol &&
+ right.X_add_symbol != NULL &&
+ right.X_subtract_symbol != NULL) {
resultP->X_add_symbol = right.X_add_symbol;
resultP->X_subtract_symbol = right.X_subtract_symbol;
seg1 = S_GET_SEGMENT(right.X_add_symbol);