Skip to content

Commit

Permalink
JDK-8340801
Browse files Browse the repository at this point in the history
  • Loading branch information
MBaesken committed Sep 25, 2024
1 parent 1b9898a commit a2f89ec
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/java.base/unix/native/include/jni_md.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@

#define JNICALL

/* macro/attribute to disable undefined behaviour sanitizer checking */
#ifndef ATTRIBUTE_NO_UBSAN
#if defined(__clang__) || defined(__GNUC__)
#define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined")))
#else
#define ATTRIBUTE_NO_UBSAN
#endif
#endif

typedef int jint;
#ifdef _LP64
typedef long jlong;
Expand Down
4 changes: 4 additions & 0 deletions src/java.base/windows/native/include/jni_md.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#define JNIIMPORT __declspec(dllimport)
#define JNICALL __stdcall

#ifndef ATTRIBUTE_NO_UBSAN
#define ATTRIBUTE_NO_UBSAN
#endif

typedef int jint;
typedef long long jlong;
typedef signed char jbyte;
Expand Down
1 change: 1 addition & 0 deletions src/java.desktop/share/native/libawt/java2d/loops/IntRgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ DEFINE_ALPHA_MASKBLIT(IntArgbPre, IntRgb, 4ByteArgb)

DEFINE_ALPHA_MASKBLIT(IntRgb, IntRgb, 4ByteArgb)

ATTRIBUTE_NO_UBSAN
DEFINE_SOLID_DRAWGLYPHLISTAA(IntRgb, 3ByteRgb)

DEFINE_SOLID_DRAWGLYPHLISTLCD(IntRgb, 3ByteRgb)
Expand Down

0 comments on commit a2f89ec

Please sign in to comment.