|
From: Klaus R. <kla...@rz...> - 2007-12-01 15:07:41
|
Hi, thanks for your report! The reason for this behavior is ming tries to combine all push-values to a single push op. In the reported special case it does not make sense to do so... In CVS-HEAD is a fix for IF() ... ELSE ... and ?: Could you give it a try ? Thanks! Klaus Am Freitag 30 November 2007 20:16:47 schrieb Albrecht Kleine: > Hi, > > if you compile a line like this: > > xtext=abs(3>4? 5:6); > > the Ming as compiler seems to generate invalid code, > listswf tells us as follows: > > 66:SWFACTION_PUSH > [000] Constant: 0 "xtext" > [001] Integer: 4 > [002] Integer: 3 > 81:SWFACTION_LESS2 > 82:SWFACTION_IF > BranchOffset: 13, TargetOffset: 100 > 2 Action > 87:SWFACTION_PUSH > [000] Integer: 6 > 95:SWFACTION_JUMP > BranchOffset: 8, TargetOffset: 108<------ jump just into operation > 100:SWFACTION_PUSH > [000] Integer: 5 > [001] Integer: 1 > [002] Constant: 1 "Math" > 115:SWFACTION_GETVARIABLE > 116:SWFACTION_PUSH > [000] Constant: 2 "abs" > 121:SWFACTION_CALLMETHOD > > To compare I tried MTASC with better results: > > 255:SWFACTION_PUSH > [000] Constant: 5 "xtext" > [001] Integer: 3 > [002] Integer: 4 > 270:SWFACTION_GREATER > 271:SWFACTION_IF > BranchOffset: 13, TargetOffset: 289 > 2 Action > 276:SWFACTION_PUSH > [000] Integer: 6 > 284:SWFACTION_JUMP > BranchOffset: 8, TargetOffset: 297 > 289:SWFACTION_PUSH > [000] Integer: 5 > 297:SWFACTION_PUSH<--------------------- an additional PUSH here > [000] Integer: 1 > [001] Constant: 6 "Math" > 307:SWFACTION_GETVARIABLE > 308:SWFACTION_PUSH > [000] Constant: 7 "abs" > 313:SWFACTION_CALLMETHOD > > As we can see, the 3rd PUSH should be splitted into 2 operations. > > Does someone could solve this problem ??? > > Cheers > Albrecht > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Ming-devr mailing list > Min...@li... > https://lists.sourceforge.net/lists/listinfo/ming-devr |