1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-04-15 15:50:28 +00:00

Note places where undefined behavior is detected by the UB sanitizer

Comments only, no functional changes.

	modified:   src/arith2.c
	modified:   src/arith3.c
	modified:   src/arith4.c
	modified:   src/xc.c
This commit is contained in:
Nick Briggs
2020-09-17 18:24:54 -07:00
parent 11690d0f9c
commit 2b02c15982
4 changed files with 8 additions and 1 deletions

View File

@@ -47,6 +47,7 @@ LispPTR N_OP_makenumber(int tosm1, int tos) {
register int result;
if (((tosm1 & 0xFFFF0000) != S_POSITIVE) || ((tos & 0xFFFF0000) != S_POSITIVE)) ERROR_EXIT(tos);
/* UB: left shift of 49152 by 16 places cannot be represented in type 'int' */
result = ((tosm1 & 0xffff) << 16) | (tos & 0xffff);
N_ARITH_SWITCH(result);
} /* end OP_makenumber */