Skip to content
Snippets Groups Projects
Commit d1e3923c authored by Gero Leinemann's avatar Gero Leinemann
Browse files

Fix for "delayedAssign" used on formerly primitive variables

parent 9331da93
Branches
No related tags found
No related merge requests found
...@@ -70,6 +70,18 @@ public class REnvTruffleFrameAccess extends REnvFrameAccessBindingsAdapter { ...@@ -70,6 +70,18 @@ public class REnvTruffleFrameAccess extends REnvFrameAccessBindingsAdapter {
super.put(key, value); super.put(key, value);
FrameDescriptor fd = frame.getFrameDescriptor(); FrameDescriptor fd = frame.getFrameDescriptor();
FrameSlot slot = fd.findFrameSlot(key); FrameSlot slot = fd.findFrameSlot(key);
// Handle RPromise: It cannot be cast to a int/double/byte!
if (value instanceof RPromise) {
if (slot == null) {
slot = fd.addFrameSlot(key, FrameSlotKind.Object);
}
// Overwrites former FrameSlotKind
frame.setObject(slot, value);
return;
}
// Handle all other values
FrameSlotKind slotKind = null; FrameSlotKind slotKind = null;
if (slot == null) { if (slot == null) {
slotKind = RRuntime.getSlotKind(value); slotKind = RRuntime.getSlotKind(value);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment