@@ -192,7 +192,10 @@ public void verifyOptionValues() {
192
192
}
193
193
194
194
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 ()) {
196
199
/* The serial GC supports changing the heap size at run-time to some degree. */
197
200
return option != SubstrateGCOptions .MinHeapSize && option != SubstrateGCOptions .MaxHeapSize && option != SubstrateGCOptions .MaxNewSize ;
198
201
}
@@ -230,12 +233,10 @@ private static Object getOptionValue(int index) {
230
233
}
231
234
232
235
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 );
239
240
}
240
241
}
241
242
@@ -344,6 +345,8 @@ private static boolean atojulong(CCharPointer s, CLongPointer result) {
344
345
}
345
346
346
347
CCharPointerPointer tailPtr = (CCharPointerPointer ) StackValue .get (CCharPointer .class );
348
+
349
+ LibC .setErrno (0 );
347
350
UnsignedWord n = LibC .strtoull (s , tailPtr , 10 );
348
351
if (LibC .errno () != 0 ) {
349
352
return false ;
0 commit comments