Skip to content

Commit d2fdef9

Browse files
Prevent optimizations
1 parent b8e02b3 commit d2fdef9

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
@@ -128,6 +128,11 @@ namespace JsRTApiTest
128128
valueRef = JS_INVALID_REFERENCE;
129129
valueRefFromWeakRef = JS_INVALID_REFERENCE;
130130

131+
// Prevent optimizations to remove the assignments above
132+
// as they are not needed from a control-flow perspective.
133+
CHECK(valueRef == JS_INVALID_REFERENCE);
134+
CHECK(valueRefFromWeakRef == JS_INVALID_REFERENCE);
135+
131136
CHECK(JsCollectGarbage(runtime) == JsNoError);
132137

133138
// JsGetWeakReferenceValue should return an invalid reference after the value was GC'd.

0 commit comments

Comments
 (0)