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:
Cyrill Gorcunov 2018-10-14 01:26:19 +03:00
parent d94402d6f7
commit ceec0d8187

View file

@ -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;
}