8330936: [ubsan] exclude function BilinearInterp and ShapeSINextSpan in libawt java2d from ubsan checks

Reviewed-by: clanger, prr
This commit is contained in:
Matthias Baesken 2025-03-06 08:10:23 +00:00
parent 649ef77951
commit 40f150d3e5
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -33,6 +33,8 @@
#include "sun_java2d_loops_TransformHelper.h"
#include "java_awt_image_AffineTransformOp.h"
#include "ub.h"
/*
* The stub functions replace the bilinear and bicubic interpolation
* functions with NOP versions so that the performance of the helper
@ -661,6 +663,7 @@ Transform_SafeHelper(JNIEnv *env,
((jubyte *)pRes)[comp] = (jubyte) ((cR + (1<<15)) >> 16); \
} while (0)
ATTRIBUTE_NO_UBSAN
static void
BilinearInterp(jint *pRGB, jint numpix,
jint xfract, jint dxfract,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -39,6 +39,8 @@
#include "sun_java2d_pipe_ShapeSpanIterator.h"
#include "java_awt_geom_PathIterator.h"
#include "ub.h"
/*
* This structure holds all of the information needed to trace and
* manage a single line segment of the shape's outline.
@ -1233,6 +1235,7 @@ ShapeSIIntersectClipBox(JNIEnv *env, void *private,
}
}
ATTRIBUTE_NO_UBSAN
static jboolean
ShapeSINextSpan(void *state, jint spanbox[])
{