From 4c3ebfd7c3b5015b0c407e04e11a69f40618269e Mon Sep 17 00:00:00 2001
From: Florian Angerer <florian.angerer@oracle.com>
Date: Thu, 1 Jun 2017 11:04:55 +0200
Subject: [PATCH] Source sections are only serialized if they refer to a file.

---
 .../src/com/oracle/truffle/r/runtime/RSerialize.java          | 4 ++--
 1 file changed, 2 insertions(+), 2 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 0ff77a7e35..a3058cb0a0 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
@@ -2114,13 +2114,13 @@ public class RSerialize {
 
         private void setSourceSection(RSyntaxElement body) {
             SourceSection lazySourceSection = body.getLazySourceSection();
-            if (lazySourceSection != RSyntaxNode.LAZY_DEPARSE) {
+            if (RSource.getPathInternal(lazySourceSection.getSource()) != null) {
                 ss = lazySourceSection;
             }
         }
 
         public boolean hasAttributes() {
-            return explicitAttributes != null && !explicitAttributes.isEmpty() || ss != null && ss != RSyntaxNode.LAZY_DEPARSE;
+            return explicitAttributes != null && !explicitAttributes.isEmpty() || ss != null;
         }
 
         public DynamicObject getExplicitAttributes() {
-- 
GitLab