diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2018-10-14 01:26:19 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2018-10-14 01:49:43 +0300 |
commit | ceec0d818798aeaa75ed4907e6135b0247ed46b2 (patch) | |
tree | a738a30ed4c3646d70a20defab5933df9beafa2a | |
parent | d94402d6f7f10ad1536a767c18c830ca7d0823a8 (diff) | |
download | nasm-ceec0d818798aeaa75ed4907e6135b0247ed46b2.tar.gz |
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>
-rw-r--r-- | asm/eval.c | 2 |
1 files changed, 1 insertions, 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; } |