Skip to content

Commit b8f3856

Browse files
author
Doug Simon
committed
8352420: [ubsan] codeBuffer.cpp:984:27: runtime error: applying non-zero offset 18446744073709486080 to null pointer
Reviewed-by: kvn, mbaesken
1 parent 0cb110e commit b8f3856

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/hotspot/share/asm/codeBuffer.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,7 @@ void CodeBuffer::take_over_code_from(CodeBuffer* cb) {
980980

981981
void CodeBuffer::verify_section_allocation() {
982982
address tstart = _total_start;
983+
if (tstart == nullptr) return; // ignore not fully initialized buffer
983984
if (tstart == badAddress) return; // smashed by set_blob(nullptr)
984985
address tend = tstart + _total_size;
985986
if (_blob != nullptr) {

src/hotspot/share/asm/codeBuffer.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 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
@@ -455,6 +455,8 @@ class CodeBuffer: public StackObj DEBUG_ONLY(COMMA private Scrubber) {
455455
_name = name;
456456
_before_expand = nullptr;
457457
_blob = nullptr;
458+
_total_start = nullptr;
459+
_total_size = 0;
458460
_oop_recorder = nullptr;
459461
_overflow_arena = nullptr;
460462
_last_insn = nullptr;

0 commit comments

Comments
 (0)