preproc: Fix malformed parameter count
commit3079f7966dbed4497e36d5067cbfd896a90358cb
authorCyrill Gorcunov <gorcunov@gmail.com>
Wed, 14 Nov 2018 07:03:42 +0000 (14 10:03 +0300)
committerCyrill Gorcunov <gorcunov@gmail.com>
Wed, 14 Nov 2018 07:26:26 +0000 (14 10:26 +0300)
treef88e5c0ff834ee8b4b16a25106cc49ac83bf8de3
parentfeabd742a3520d0835428f47d474979b4566c4ce
preproc: Fix malformed parameter count

readnum returns 64bit number which may become
a negative integer upon conversion which in
turn lead to out of bound array access.

Fix it by explicit conversion with bounds check

 | POC6:2: error: parameter count `2222222222' is out of bounds [0; 2147483647]

https://bugzilla.nasm.us/show_bug.cgi?id=3392528

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
asm/preproc.c