Skip to content
Snippets Groups Projects
Commit 1e395ae9 authored by Lukas Stadler's avatar Lukas Stadler
Browse files

[GR-7569] Fix infinite recursion for non-vector, non-list TruffleObjects in RDeparse.

PullRequest: fastr/1313
parents e219db94 1dfba858
No related branches found
No related tags found
No related merge requests found
......@@ -813,13 +813,15 @@ public class RDeparse {
}
} else if (value instanceof TruffleObject) {
Object rObject = new TruffleObjectConverter().convert((TruffleObject) value);
append("<foreign object: ");
if (rObject != null) {
appendConstant(rObject);
if (rObject == value) {
append("<foreign object>");
} else if (rObject == null) {
append("<foreign object: null>");
} else {
append("null");
append("<foreign object: ");
appendConstant(rObject);
append('>');
}
append('>');
} else {
throw RInternalError.shouldNotReachHere("unexpected type while deparsing constant: " + value == null ? "null" : value.getClass().getSimpleName());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment