mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
eval: Eliminate division by zero
When doing division we should detect if the value we're divided by is not zero. Instead of is_unknown() helper we should use is_just_unknown(). https://bugzilla.nasm.us/show_bug.cgi?id=3392515 https://bugzilla.nasm.us/show_bug.cgi?id=3392473 Reported-by: Jun <jxx13@psu.edu> Reported-by: stuartly <situlingyun@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
d94402d6f7
commit
ceec0d8187
1 changed files with 1 additions and 1 deletions
|
|
@ -580,7 +580,7 @@ static expr *expr5(int critical)
|
|||
" scalar values");
|
||||
return NULL;
|
||||
}
|
||||
if (j != '*' && !is_unknown(f) && reloc_value(f) == 0) {
|
||||
if (j != '*' && !is_just_unknown(f) && reloc_value(f) == 0) {
|
||||
nasm_error(ERR_NONFATAL, "division by zero");
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue