Skip to content

Commit

Permalink
8327986: ASAN reports use-after-free in DirectivesParserTest.empty_ob…
Browse files Browse the repository at this point in the history
…ject_vm

Reviewed-by: kvn, djelinski
  • Loading branch information
tstuefe committed Mar 28, 2024
1 parent d580bcf commit 47f33a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/hotspot/gtest/compiler/test_directivesParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@

class DirectivesParserTest : public ::testing::Test{
protected:
const char* const _locale;
char* const _locale;
ResourceMark rm;
stringStream stream;
// These tests require the "C" locale to correctly parse decimal values
DirectivesParserTest() : _locale(setlocale(LC_NUMERIC, nullptr)) {
DirectivesParserTest() : _locale(os::strdup(setlocale(LC_NUMERIC, nullptr), mtTest)) {
setlocale(LC_NUMERIC, "C");
}
~DirectivesParserTest() {
setlocale(LC_NUMERIC, _locale);
os::free(_locale);
}

void test_negative(const char* text) {
Expand Down

0 comments on commit 47f33a5

Please sign in to comment.