This server is intended for use for Academic Classwork related Git repositories only. Projects/repositories will generally be removed after 6 months following close of the semester. Inactive repositories from previous semester are now being archived when no activity for 365 days. They are renamed and marked as 'archived'. After 90 days in that state they will be removed from the system completely.

Commit 3b1035da authored by Hogan's avatar Hogan

Added Division by 0 error

parent a674f3d9
......@@ -401,7 +401,10 @@ N_ARITHLOGIC_EXPR : N_UN_OP N_EXPR
case MULTIPLY:
$$.value.number = $2.value.number * $3.value.number;
break;
//$3 .value != 0
case DIVIDE:
if($3.value.number == 0)
yyerror("Attempted division by zero");
$$.value.number = $2.value.number / $3.value.number;
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment