<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Doesn't quite work, but is disabled. I have to debug it and then enable it later..<br><br><br>Index: misc/Marker.m3<br>===================================================================<br>RCS file: /usr/cvs/cm3/m3-sys/m3front/src/misc/Marker.m3,v<br>retrieving revision 1.10<br>diff -u -r1.10 Marker.m3<br>--- misc/Marker.m3    11 Feb 2011 20:57:57 -0000    1.10<br>+++ misc/Marker.m3    5 Mar 2013 05:36:32 -0000<br>@@ -232,7 +232,9 @@<br>   END CallFinallyHandler;<br> <br> PROCEDURE CaptureState (frame: CG.Var;  handler: CG.Label) =<br>+  CONST Alloca_jmpbuf = FALSE;<br>   VAR new: BOOLEAN;<br>+      label_already_allocated: CG.Label;<br>   BEGIN<br>     (* int setjmp(void* ); *)<br>     IF (setjmp = NIL) THEN<br>@@ -246,8 +248,51 @@<br>                                f := CG.Never);<br>       END;<br>     END;<br>+    <br>+    IF Alloca_jmpbuf THEN<br>+      label_already_allocated := CG.Next_label ();<br>+<br>+      (* void* _alloca(size_t); *)<br>+      IF (alloca = NIL) THEN<br>+        alloca := CG.Import_procedure (M3ID.Add ("m3_alloca"), 1, CG.Type.Addr,<br>+                                       Target.DefaultCall, new);<br>+        IF (new) THEN<br>+          EVAL CG.Declare_param (M3ID.NoID, Target.Word.size, Target.Word.align,<br>+                                 Target.Word.cg_type, 0, in_memory := FALSE,<br>+                                 up_level := FALSE, f := CG.Never);<br>+        END;<br>+      END;<br>+      (* extern /*const*/ size_t Csetjmp__Jumpbuf_size/* = sizeof(jmp_buf)*/; *)<br>+      IF (Jumpbuf_size = NIL) THEN<br>+        Jumpbuf_size := CG.Import_global (M3ID.Add ("Csetjmp__Jumpbuf_size"),<br>+                                          Target.Word.size, Target.Word.align,<br>+                                          Target.Word.cg_type, 0);<br>+      END;<br>+    <br>+      (* if (!frame.jmpbuf)<br>+           frame.jmpbuf = alloca(Csetjmp__Jumpbuf_size);<br>+      *)<br>+      CG.Load_addr (frame, M3RT.EF1_jmpbuf);<br>+      CG.Load_nil ();<br>+      CG.If_compare (Target.Address.cg_type, CG.Cmp.NE, label_already_allocated, CG.Likely);<br>+<br>+      CG.Start_call_direct (alloca, 0, Target.Address.cg_type);<br>+      CG.Load_int (Target.Word.cg_type, Jumpbuf_size);<br>+      CG.Pop_param (Target.Word.cg_type);<br>+      CG.Call_direct (alloca, Target.Address.cg_type);<br>+      CG.Check_nil (CG.RuntimeError.BadMemoryReference);<br>+      CG.Store_addr (frame, M3RT.EF1_jmpbuf);<br>+<br>+      CG.Set_label (label_already_allocated);<br>+    END;<br>+<br>+    (* setjmp(frame.jmpbuf) or setjmp(&frame.jmpbuf) *)<br>     CG.Start_call_direct (setjmp, 0, Target.Integer.cg_type);<br>-    CG.Load_addr_of (frame, M3RT.EF1_jmpbuf, 64);<br>+    IF Alloca_jmpbuf THEN<br>+      CG.Load_addr (frame, M3RT.EF1_jmpbuf);<br>+    ELSE<br>+      CG.Load_addr_of (frame, M3RT.EF1_jmpbuf, 64);<br>+    END;<br>     CG.Pop_param (CG.Type.Addr);<br>     CG.Call_direct (setjmp, Target.Integer.cg_type);<br>     CG.If_true (handler, CG.Never);<br><br><br><br><br><br><div><div id="SkyDrivePlaceholder"></div>> Date: Tue, 5 Mar 2013 06:37:33 +0000<br>> To: m3commit@elegosoft.com<br>> From: jkrell@elego.de<br>> Subject: [M3commit] CVS Update: cm3<br>> <br>> CVSROOT:  /usr/cvs<br>> Changes by:      jkrell@birch.   13/03/05 06:37:33<br>> <br>> Modified files:<br>>    cm3/m3-sys/m3front/src/misc/: Marker.m3 <br>> <br>> Log message:<br>>        The change to remove knowledge of jmpbuf size from cm3.<br>>   But as yet disabled with a const boolean enable_foo = false.<br>> <br></div>                                         </div></body>
</html>