diff --git a/nemu/src/monitor/sdb/addrexp.y b/nemu/src/monitor/sdb/addrexp.y index 5707be3..f429b18 100644 --- a/nemu/src/monitor/sdb/addrexp.y +++ b/nemu/src/monitor/sdb/addrexp.y @@ -25,7 +25,7 @@ expression | expression '+' expression { $$ = $1 + $3; } | expression '-' expression { $$ = $1 - $3; } | expression '*' expression { $$ = $1 * $3; } - | expression '/' expression { $$ = $1 / $3; if($3 == 0) perror("Devide by 0\n");} + | expression '/' expression { $$ = $1 / $3; if($3 == 0) perror("Devide by 0\n"); YYABORT; } | '-' number { $$ = -$2; } | '(' expression ')' { $$ = $2; }