@@ -192,7 +192,10 @@ public void verifyOptionValues() {
192192 }
193193
194194 private static boolean shouldValidate (RuntimeOptionKey <?> option ) {
195- if (SubstrateOptions .UseSerialGC .getValue ()) {
195+ if (!option .hasBeenSet ()) {
196+ /* Workaround for one specific Truffle language that does something weird. */
197+ return false ;
198+ } else if (SubstrateOptions .UseSerialGC .getValue ()) {
196199 /* The serial GC supports changing the heap size at run-time to some degree. */
197200 return option != SubstrateGCOptions .MinHeapSize && option != SubstrateGCOptions .MaxHeapSize && option != SubstrateGCOptions .MaxNewSize ;
198201 }
@@ -230,12 +233,10 @@ private static Object getOptionValue(int index) {
230233 }
231234
232235 private static void validate (RuntimeOptionKey <?> option , Object oldValue ) {
233- if (option .hasBeenSet ()) {
234- Object newValue = option .getValue ();
235- if (newValue == null || !newValue .equals (oldValue )) {
236- throw new IllegalArgumentException (
237- "The option '" + option .getName () + "' can't be changed after isolate creation. Old value: " + oldValue + ", new value: " + newValue );
238- }
236+ Object newValue = option .getValue ();
237+ if (newValue == null || !newValue .equals (oldValue )) {
238+ throw new IllegalArgumentException (
239+ "The option '" + option .getName () + "' can't be changed after isolate creation. Old value: " + oldValue + ", new value: " + newValue );
239240 }
240241 }
241242
@@ -344,6 +345,8 @@ private static boolean atojulong(CCharPointer s, CLongPointer result) {
344345 }
345346
346347 CCharPointerPointer tailPtr = (CCharPointerPointer ) StackValue .get (CCharPointer .class );
348+
349+ LibC .setErrno (0 );
347350 UnsignedWord n = LibC .strtoull (s , tailPtr , 10 );
348351 if (LibC .errno () != 0 ) {
349352 return false ;
0 commit comments