mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8331421: ubsan: vmreg.cpp checking error member call on misaligned address
Reviewed-by: mbaesken
Backport-of: beebce044d
This commit is contained in:
committed by
Vitaly Provodin
parent
85249f35a0
commit
e3df281f37
@@ -30,7 +30,7 @@
|
||||
// used by SA and jvmti, but it's a leaky abstraction: SA and jvmti
|
||||
// "know" that stack0 is an integer masquerading as a pointer. For the
|
||||
// sake of those clients, we preserve this interface.
|
||||
VMReg VMRegImpl::stack0 = (VMReg)VMRegImpl::stack_0()->value();
|
||||
VMReg VMRegImpl::stack0 = (VMReg)(intptr_t)FIRST_STACK;
|
||||
|
||||
// VMRegs are 4 bytes wide on all platforms
|
||||
const int VMRegImpl::stack_slot_size = 4;
|
||||
|
||||
@@ -53,7 +53,8 @@ friend class OptoReg;
|
||||
// friend class Location;
|
||||
private:
|
||||
enum {
|
||||
BAD_REG = -1
|
||||
BAD_REG = -1,
|
||||
FIRST_STACK = (ConcreteRegisterImpl::number_of_registers + 7) & ~7
|
||||
};
|
||||
|
||||
// Despite being private, this field is exported to the
|
||||
@@ -70,7 +71,7 @@ private:
|
||||
public:
|
||||
|
||||
static constexpr VMReg stack_0() {
|
||||
return first() + ((ConcreteRegisterImpl::number_of_registers + 7) & ~7);
|
||||
return first() + FIRST_STACK;
|
||||
}
|
||||
|
||||
static VMReg as_VMReg(int val, bool bad_ok = false) {
|
||||
|
||||
Reference in New Issue
Block a user