Skip to content

Commit 486aa11

Browse files
committed
8335237: ubsan: vtableStubs.hpp is_vtable_stub exclude from ubsan checks
Reviewed-by: mdoerr, clanger
1 parent f4d8c00 commit 486aa11

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/hotspot/share/code/vtableStubs.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, 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
@@ -28,6 +28,7 @@
2828
#include "asm/macroAssembler.hpp"
2929
#include "code/vmreg.hpp"
3030
#include "memory/allStatic.hpp"
31+
#include "sanitizers/ub.hpp"
3132
#include "utilities/checkedCast.hpp"
3233

3334
// A VtableStub holds an individual code stub for a pair (vtable index, #args) for either itables or vtables
@@ -173,6 +174,9 @@ class VtableStub {
173174
public:
174175
// Query
175176
bool is_itable_stub() { return !_is_vtable_stub; }
177+
// We reinterpret arbitrary memory as VtableStub. This does not cause failures because the lookup/equality
178+
// check will reject false objects. Disabling UBSan is a temporary workaround until JDK-8331725 is fixed.
179+
ATTRIBUTE_NO_UBSAN
176180
bool is_vtable_stub() { return _is_vtable_stub; }
177181
bool is_abstract_method_error(address epc) { return epc == code_begin()+_ame_offset; }
178182
bool is_null_pointer_exception(address epc) { return epc == code_begin()+_npe_offset; }

0 commit comments

Comments
 (0)