From: nasm-bot f. C. G. <gor...@gm...> - 2018-10-13 22:51:15
|
Commit-ID: ceec0d818798aeaa75ed4907e6135b0247ed46b2 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=ceec0d818798aeaa75ed4907e6135b0247ed46b2 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sun, 14 Oct 2018 01:26:19 +0300 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 14 Oct 2018 01:49:43 +0300 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 <jx...@ps...> Reported-by: stuartly <sit...@gm...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- asm/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asm/eval.c b/asm/eval.c index 1a6680f..7e727a4 100644 --- a/asm/eval.c +++ b/asm/eval.c @@ -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; } |