bc: declare interntional unsafe fixnum arithmetic

Eliminate overflow errors from fixnum test when racket bc compiled with
--enable-ubsan (issue #2314)
This commit is contained in:
xxyzz 2020-09-22 13:57:32 +00:00 committed by GitHub
parent d24cbd4344
commit 659741bb58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -84,7 +84,9 @@ jobs:
continue-on-error: true
run: raco test -l tests/db/all-tests | tee logs/db-all-tests.log
- name: Gather runtime errors
run: grep 'runtime error' logs/*.log > runtime-errors_git${{ github.sha }}.log
run: |
grep 'runtime error' logs/*.log > runtime-errors_git${{ github.sha }}.log || true
test ! -s runtime-errors_git${{ github.sha }}.log
- uses: actions/upload-artifact@v2
with:
name: runtime-errors_git${{ github.sha }}

View File

@ -1228,7 +1228,14 @@ static Scheme_Object *fx_abs(int argc, Scheme_Object *argv[])
return o;
}
#define UNSAFE_FX(name, op, fold, zero_args, PRE_CHECK) \
#if __GNUC__ >= 8 || __clang_major__ >= 4
# define NO_SANITIZE_SIGNED_INTEGER_OVERFLOW \
__attribute__((no_sanitize("signed-integer-overflow")))
#else
# define NO_SANITIZE_SIGNED_INTEGER_OVERFLOW
#endif
#define UNSAFE_FX(name, op, fold, zero_args, PRE_CHECK) \
NO_SANITIZE_SIGNED_INTEGER_OVERFLOW \
static Scheme_Object *name(int argc, Scheme_Object *argv[]) \
{ \
intptr_t v; \