<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'>And the problem here is that ETimer__Push<br>contains a parameter "t" and a local in a nested block "t".<BR><br> <BR>ETimer_Push(t)<br>{<br> {<br> t<br> stuff with inner t<br> }<br> stuff with outer t<br>}<BR> <BR><br>Normally this'd be dealt with begin_block/end_block.<br>However because import_procedure comes in at arbitrary<br>times, and is needed to remain in scope from there on,<br>I ignore begin/end_block -- and the braces above aren't present.<BR> <BR><br>Longer term I will move all the declarations from import_procedure<br>up to global scope, and then honor begin/end_block.<br>Would be nice if frontend did this but oh well.<BR> <BR><br>So for now I munge all parameters/locals (except "_static_link")<br>with a unique number on the end, so these two aren't the same.<BR> <BR>Now we get much further.<br>We get to cm3 trying to open files, the files aren't present, it raises an exception.<BR> <BR>Raising an exception doesn't work due to a small stupid error of extra work I did.<br>I wasn't adding static_links to exception handlers because they already have a parameter.<br>Likely fix is to stop special casing exception handlers.<BR> <BR>(Btw, Tony -- we should have<br> m3cg.try <br> m3cg.finally <br> m3cg.except whatever that means (what are the parameters? I guess types?)<br> and maybe:<br> m3cg.understands_try <br> m3cg.understands_finally <br> m3cg.understands_except whatever that means <br> and maybe: <br> m3cg.is_pass_through which means, something like, the backend doesn't<br> really understand anything, please make all the calls and a later backend<br> might ignore some -- if it is workable to make ignored calls.<BR> <BR>I'll try to think about later, much later.<br>And come up wwith something that doesn't break existing backends.<br>Obvious goals:<br> a new backend that understands try/finally/except has a enough information<br> to a) use setjmp/longjmp<br> or b) use Microsoft C source __try/__except/__finally and the VMS/Tru64/Ultrix equivalents<br> or c) use C++ source try/except/finally<br> or d) use the IA64 ABI ? <br> or e) generate Java source or bytecodes<BR>Maybe even a goal where you could layer a thin new filter m3cg on top of an older one<br>and all the thin new filter m3cg does is change try/except/finally to setjmp/longjmp.<br>That'd be nifty if we could achieve it.<br>Some sort of "dynamic chaining of m3cg".<br> )<BR> <BR>I also wasn't defining structs right for a bit there.<BR>struct {short a; char b;} m3_struct3_t isn't really guaranteed 3 bytes.<BR> <BR>We might have a problem there.<BR>So I have:<BR>struct {char a[3];} m3_struct3_t isn't really guaranteed 3 bytes.<BR> <BR>but we might cast and read a 2 byte integer out of that, and the alignment could be off.<BR>x86/AMD64 don't care so I'm ignoring it.<BR>The higher level IR might/will fix it. We'll see.<BR> <BR>Also probably this doesn't happen -- if I actually have a record with a uint16 or uint32, the front end will pad it up in size.. There's still something I need to fix here..not urgent..<BR> <BR><br> Later,<br> - Jay<br><br><br><br> <BR><div><div id="SkyDrivePlaceholder"></div>> Date: Wed, 19 Sep 2012 06:55:39 +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. 12/09/19 06:55:39<br>> <br>> Modified files:<br>> cm3/m3-sys/m3back/src/: M3C.m3 <br>> <br>> Log message:<br>> put line directives in comments (for now)<br>> put static_link last instead of first<br>> This lets us get much further:<br>> RunMainBody: exec: ../src/etimer/ETimer.m3(3)<br>> <br>> Program received signal EXC_BAD_ACCESS, Could not access memory.<br>> Reason: KERN_PROTECTION_FAILURE at address: 0x00000004<br>> 0x00343511 in ETimer__Push (t=0x16bc1b8 "??B") at ETimer.mc.c:743<br>> 743 (*(volatile INT32*)(4+(ADDRESS)*(volatile ADDRESS*)&L_14))=(INT32)(((INT32)(((INT32)(((INT32)(*(volatile INT32*)(4+(ADDRESS)*(volatile ADDRESS*)&L_14)))+((INT32)(((INT32)1))))))));<br>> (gdb)<br>> <br>> (before at Main(0) we ran the body, which was wrong)<br>> <br>> print min32 and min64 as -max32 and -max64-1 to fix warning<br>> <br></div> </div></body>
</html>