|
From: Albrecht K. <kl...@ak...> - 2007-11-30 19:30:41
|
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
|