File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/main/java/org/truffleruby/core/kernel Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -416,6 +416,7 @@ RubyClass getClass(Object self) {
416
416
@ GenerateInline (inlineByDefault = true )
417
417
public abstract static class CopyInstanceVariablesNode extends RubyBaseNode {
418
418
419
+ public static final DynamicObjectLibrary [] EMPTY_DYNAMIC_OBJECT_LIBRARY_ARRAY = new DynamicObjectLibrary [0 ];
419
420
public static final PropertyGetter [] EMPTY_PROPERTY_GETTER_ARRAY = new PropertyGetter [0 ];
420
421
421
422
public abstract RubyDynamicObject execute (Node node , RubyDynamicObject newObject , RubyDynamicObject from );
@@ -466,6 +467,10 @@ protected static PropertyGetter[] getCopiedProperties(Shape shape) {
466
467
}
467
468
468
469
protected DynamicObjectLibrary [] createWriteFieldNodes (PropertyGetter [] propertyGetters ) {
470
+ if (propertyGetters .length == 0 ) {
471
+ return EMPTY_DYNAMIC_OBJECT_LIBRARY_ARRAY ;
472
+ }
473
+
469
474
final DynamicObjectLibrary [] nodes = new DynamicObjectLibrary [propertyGetters .length ];
470
475
for (int i = 0 ; i < propertyGetters .length ; i ++) {
471
476
nodes [i ] = DynamicObjectLibrary .getFactory ().createDispatched (1 );
You can’t perform that action at this time.
0 commit comments