Fix up the operator printing for the logic or and beyond, check array bounds.

This commit is contained in:
Eric Anholt
2010-03-25 16:47:49 -07:00
parent acb36240e5
commit 2f9ca7dce2
+4
View File
@@ -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];
}