scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit a4c8e1174b66b4f23599fcc2002266ec8e09940f
parent 1746690c84c53d20b755ad7bbd7dd002b8e987b4
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 10 Sep 2017 06:38:36 +0200

[as] Control overflow of packed bytes

This function is going to be called for every immediate that is
going to be printout, so it is the best place where control
the error.

Diffstat:
as/emit.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/as/emit.c b/as/emit.c @@ -80,6 +80,9 @@ pack(TUINT v, int n, int inc) idx += inc; v >>= 8; } + + if (v) + error("overflow in immediate value"); return buf; }