Skip to content

Commit 40f150d

Browse files
committedMar 6, 2025
8330936: [ubsan] exclude function BilinearInterp and ShapeSINextSpan in libawt java2d from ubsan checks
Reviewed-by: clanger, prr
1 parent 649ef77 commit 40f150d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎src/java.desktop/share/native/libawt/java2d/loops/TransformHelper.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
3333
#include "sun_java2d_loops_TransformHelper.h"
3434
#include "java_awt_image_AffineTransformOp.h"
3535

36+
#include "ub.h"
37+
3638
/*
3739
* The stub functions replace the bilinear and bicubic interpolation
3840
* functions with NOP versions so that the performance of the helper
@@ -661,6 +663,7 @@ Transform_SafeHelper(JNIEnv *env,
661663
((jubyte *)pRes)[comp] = (jubyte) ((cR + (1<<15)) >> 16); \
662664
} while (0)
663665

666+
ATTRIBUTE_NO_UBSAN
664667
static void
665668
BilinearInterp(jint *pRGB, jint numpix,
666669
jint xfract, jint dxfract,

‎src/java.desktop/share/native/libawt/java2d/pipe/ShapeSpanIterator.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
3939
#include "sun_java2d_pipe_ShapeSpanIterator.h"
4040
#include "java_awt_geom_PathIterator.h"
4141

42+
#include "ub.h"
43+
4244
/*
4345
* This structure holds all of the information needed to trace and
4446
* manage a single line segment of the shape's outline.
@@ -1233,6 +1235,7 @@ ShapeSIIntersectClipBox(JNIEnv *env, void *private,
12331235
}
12341236
}
12351237

1238+
ATTRIBUTE_NO_UBSAN
12361239
static jboolean
12371240
ShapeSINextSpan(void *state, jint spanbox[])
12381241
{

0 commit comments

Comments
 (0)
Please sign in to comment.