Skip to content

Commit cfe6477

Browse files
Prevent optimizations on x86
The compiler inlines the `pattern` parameter of `WritePattern` onto the stack because it's only ever set to one value.
1 parent b8f0814 commit cfe6477

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bin/NativeTests/JsRTApiTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ namespace JsRTApiTest
174174
}
175175
};
176176

177+
// Test two patterns to prevent compiler optimizations
178+
179+
Helper::WritePattern(0x24);
180+
REQUIRE(Helper::VerifyPattern(0x24) == true);
181+
177182
Helper::WritePattern(0x42);
178183
REQUIRE(Helper::VerifyPattern(0x42) == true);
179184
REQUIRE(JsGarbageCollectionClearStack() == JsNoError);

0 commit comments

Comments
 (0)