| commit | 2f9ca7dce2adea10d7947e98690b729cce947938 | [log] [tgz] |
|---|---|---|
| author | Eric Anholt <eric@anholt.net> | Thu Mar 25 16:47:49 2010 -0700 |
| committer | Eric Anholt <eric@anholt.net> | Thu Mar 25 16:47:49 2010 -0700 |
| tree | 21e219fd9fccd43e339ee2aefb2e1f0512303094 | |
| parent | acb36240e5c628db8cbdd43912e6b24967d2b2f2 [diff] [blame] |
Fix up the operator printing for the logic or and beyond, check array bounds.
diff --git a/ast_expr.cpp b/ast_expr.cpp index ad29cdc..4e83dec 100644 --- a/ast_expr.cpp +++ b/ast_expr.cpp
@@ -50,6 +50,7 @@ "~", "&&", "^^", + "||", "!", "*=", @@ -64,6 +65,7 @@ "|=", "?:", + "++", "--", "++", @@ -71,6 +73,8 @@ ".", }; + assert((unsigned int)op < sizeof(operators) / sizeof(operators[0])); + return operators[op]; }