Fix UB signed integer overflow in js_math_imul

- Use uint32_t arithmetics and Standard conformant conversion to
  avoid UB in js_math_imul.
- add builtin tests
- use specific object directories for SAN targets
This commit is contained in:
Charlie Gordon
2024-02-17 21:15:29 +01:00
parent 8df4327559
commit 85fb2caeae
3 changed files with 21 additions and 5 deletions

View File

@@ -56,6 +56,16 @@ CONFIG_BIGNUM=y
OBJDIR=.obj
ifdef CONFIG_ASAN
OBJDIR:=$(OBJDIR)/asan
endif
ifdef CONFIG_MSAN
OBJDIR:=$(OBJDIR)/msan
endif
ifdef CONFIG_UBSAN
OBJDIR:=$(OBJDIR)/ubsan
endif
ifdef CONFIG_DARWIN
# use clang instead of gcc
CONFIG_CLANG=y