aboutsummaryrefslogtreecommitdiffstats
path: root/ast_expr.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-03-25 16:47:49 -0700
committerEric Anholt <[email protected]>2010-03-25 16:47:49 -0700
commit2f9ca7dce2adea10d7947e98690b729cce947938 (patch)
tree21e219fd9fccd43e339ee2aefb2e1f0512303094 /ast_expr.cpp
parentacb36240e5c628db8cbdd43912e6b24967d2b2f2 (diff)
Fix up the operator printing for the logic or and beyond, check array bounds.
Diffstat (limited to 'ast_expr.cpp')
-rw-r--r--ast_expr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/ast_expr.cpp b/ast_expr.cpp
index ad29cdc68d7..4e83decb924 100644
--- a/ast_expr.cpp
+++ b/ast_expr.cpp
@@ -50,6 +50,7 @@ ast_expression::operator_string(enum ast_operators op)
"~",
"&&",
"^^",
+ "||",
"!",
"*=",
@@ -64,6 +65,7 @@ ast_expression::operator_string(enum ast_operators op)
"|=",
"?:",
+
"++",
"--",
"++",
@@ -71,6 +73,8 @@ ast_expression::operator_string(enum ast_operators op)
".",
};
+ assert((unsigned int)op < sizeof(operators) / sizeof(operators[0]));
+
return operators[op];
}