From 0721e94a9e56c925dbde79134f8735de6252e9b3 Mon Sep 17 00:00:00 2001 From: Florian Angerer <florian.angerer@oracle.com> Date: Thu, 1 Jun 2017 17:39:11 +0200 Subject: [PATCH] Fix: Do not set source section for builtins. --- .../src/com/oracle/truffle/r/runtime/RSerialize.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java index 765edbe3cc..7aed042bc1 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java @@ -1463,7 +1463,7 @@ public class RSerialize { } terminatePairList(); writeItem(RNull.instance); // hashtab - OutAttributes attributes = new OutAttributes(env, type); + OutAttributes attributes = new OutAttributes(env, type, gnuRType); if (attributes.hasAttributes()) { writeAttributes(attributes); } else { @@ -1472,7 +1472,7 @@ public class RSerialize { } } else { // flags - OutAttributes attributes = new OutAttributes(obj, type); + OutAttributes attributes = new OutAttributes(obj, type, gnuRType); boolean hasTag = gnuRType == SEXPTYPE.CLOSXP || gnuRType == SEXPTYPE.DOTSXP || (gnuRType == SEXPTYPE.PROMSXP && !((RPromise) obj).isEvaluated()) || (type == SEXPTYPE.LISTSXP && !((RPairList) obj).isNullTag()); int gpbits = getGPBits(obj); @@ -2096,16 +2096,16 @@ public class RSerialize { private DynamicObject explicitAttributes; private SourceSection ss; - private OutAttributes(Object obj, SEXPTYPE type) { + private OutAttributes(Object obj, SEXPTYPE type, SEXPTYPE gnuRType) { if (obj instanceof RAttributable) { explicitAttributes = ((RAttributable) obj).getAttributes(); } - initSourceSection(obj, type); + initSourceSection(obj, type, gnuRType); } - private void initSourceSection(Object obj, SEXPTYPE type) { - if (type == SEXPTYPE.FUNSXP) { + private void initSourceSection(Object obj, SEXPTYPE type, SEXPTYPE gnuRType) { + if (type == SEXPTYPE.FUNSXP && gnuRType != SEXPTYPE.BUILTINSXP) { RFunction fun = (RFunction) obj; RSyntaxFunction body = (RSyntaxFunction) fun.getRootNode(); setSourceSection(body); -- GitLab