[127988] trunk/dports/lang/pure

ryandesign at macports.org ryandesign at macports.org
Sun Nov 9 23:23:15 PST 2014


Revision: 127988
          https://trac.macports.org/changeset/127988
Author:   ryandesign at macports.org
Date:     2014-11-09 23:23:15 -0800 (Sun, 09 Nov 2014)
Log Message:
-----------
pure: fix the debugger (#45827)

Modified Paths:
--------------
    trunk/dports/lang/pure/Portfile

Added Paths:
-----------
    trunk/dports/lang/pure/files/pure-0.64-debugger-hotfix.diff

Modified: trunk/dports/lang/pure/Portfile
===================================================================
--- trunk/dports/lang/pure/Portfile	2014-11-10 07:03:07 UTC (rev 127987)
+++ trunk/dports/lang/pure/Portfile	2014-11-10 07:23:15 UTC (rev 127988)
@@ -40,7 +40,7 @@
 configure.env           PATH=${llvm_prefix}/bin:$env(PATH)
 
 if {${name} eq ${subport}} {
-    revision                    0
+    revision                    1
     
     depends_lib                 port:gmp \
                                 port:libiconv \
@@ -66,6 +66,9 @@
 
     # Last-minute fixes to the ATS inlining support
     patchfiles-append           pure-0.64-ats-hotfixes.diff
+
+    # Critical bugfix in the debugger (issue #32)
+    patchfiles-append           pure-0.64-debugger-hotfix.diff
     
     platform macosx {
         depends_run-replace     port:w3m port:openbrowser

Added: trunk/dports/lang/pure/files/pure-0.64-debugger-hotfix.diff
===================================================================
--- trunk/dports/lang/pure/files/pure-0.64-debugger-hotfix.diff	                        (rev 0)
+++ trunk/dports/lang/pure/files/pure-0.64-debugger-hotfix.diff	2014-11-10 07:23:15 UTC (rev 127988)
@@ -0,0 +1,74 @@
+diff -r 0163df6e1ff4 pure/interpreter.cc
+--- interpreter.cc	Fri Nov 07 16:05:11 2014 -0600
++++ interpreter.cc	Sun Nov 09 12:50:19 2014 +0100
+@@ -17156,12 +17156,12 @@
+       debug(msg.str().c_str()); }
+ #endif
+     if (retv) {
++      if (rp) debug_redn(rp, retv);
+       if (f.n+f.m != 0 || !debugging) {
+ 	// do cleanup
+ 	Function *free_fun = module->getFunction("pure_pop_args");
+ 	f.builder.CreateCall3(free_fun, retv, UInt(f.n), UInt(f.m));
+       }
+-      if (rp) debug_redn(rp, retv);
+       f.builder.CreateRet(retv);
+     } else if (tail) {
+       // Tail-recursive type rule. Perform a direct tail call on the rightmost
+diff -r 0163df6e1ff4 pure/printer.cc
+--- printer.cc	Fri Nov 07 16:05:11 2014 -0600
++++ printer.cc	Sun Nov 09 12:50:19 2014 +0100
+@@ -917,6 +917,7 @@
+ static inline bool pstr(ostream& os, pure_expr *x)
+ {
+   static bool recursive = false;
++  if (!x) return false;
+   if (recursive ||
+       // We don't want to force a thunk here. Unfortunately, this means that
+       // currently you can't define a print representation for a thunk, at
+@@ -928,7 +929,6 @@
+   map<int32_t,GlobalVar>::iterator it;
+   if (f > 0 && (it = interp.globalvars.find(f)) != interp.globalvars.end() &&
+       it->second.x && it->second.x->tag >= 0 && it->second.x->data.clos) {
+-    assert(x->refc > 0);
+     pure_aframe *ex = interp.push_aframe(interp.sstk_sz);
+     if (setjmp(ex->jmp)) {
+       // caught an exception
+@@ -943,21 +943,27 @@
+       recursive = false;
+       return false;
+     } else {
++      bool ret = false;
+       recursive = true;
++      // The argument expression may well be a temporary if we're being
++      // invoked internally, so make sure that it doesn't get collected
++      // prematurely.
++      pure_ref(x);
+       pure_expr *y = pure_app(it->second.x, x);
+       interp.pop_aframe();
+       recursive = false;
+-      assert(y);
+-      if (y->tag == EXPR::STR) {
+-	char *s = fromutf8(y->data.s);
++      if (y) {
++	if (y->tag == EXPR::STR) {
++	  char *s = fromutf8(y->data.s);
++	  if (s) {
++	    os << s; free(s);
++	    ret = true;
++	  }
++	}
+ 	pure_freenew(y);
+-	if (s) {
+-	  os << s; free(s);
+-	  return true;
+-	} else
+-	  return false;
+-      } else
+-	return false;
++      }
++      pure_unref(x);
++      return ret;
+     }
+   } else
+     return false;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20141109/de2f60e0/attachment-0001.html>


More information about the macports-changes mailing list