RFR: 8358957: [ubsan]: The assert in layout_helper_boolean_diffbit() in klass.hpp needs UB to fail [v7]

Afshin Zafari azafari at openjdk.org
Wed Nov 12 09:18:50 UTC 2025


On Wed, 12 Nov 2025 04:10:28 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Windows warning bypassed
>
> src/hotspot/share/oops/klass.hpp line 515:
> 
>> 513: 
>> 514:   // VS warns (C4146) about unary minus of unsigned.
>> 515:   PRAGMA_DISABLE_MSVC_WARNING(4146)
> 
> It seems that some time ago (JDK-8254072) 4146 was disabled for JVM MSVC build:
> https://github.com/openjdk/jdk/blame/8531fa146be1da5e96c0f23091882a27c67d7893/make/hotspot/lib/CompileJvm.gmk#L117
> 
> So the warning isn't a concern after all. Sorry for the false alarm and
> misleading guidance.
> 
> This was also not the correct way to introduce the warning suppression had it
> been needed, but that's moot.

Thanks for the comment. 
You're right, I used the function scope of the pragma instead of the instruction scope.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27288#discussion_r2517522264


More information about the hotspot-dev mailing list