help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] STCompiler input bug?


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] STCompiler input bug?
Date: Sat, 24 Sep 2011 15:19:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2

On 09/24/2011 11:27 AM, Holger Hans Peter Freyther wrote:
> 
> when using the STCompiler I end up with a MessageNotUnderstood error:
> 
> STInST.STEvaluationDriver new parseSmalltalk: '[:each :ablock | (each) ifTrue:
> ablock]!' with: STInST.STFileInParser
> 
> 
> In STCompiler>>#compileBoolean: aNode will be '(each) ifTrue:..' the arguments
> is the RBVariableNode and RBVariableNode does not understand arguments/body.
> So somehow the bytecode for STCompiler>>#acceptVariableNode would need to end
> up in bc1 and bc2?

ablock would need to be replaced with [ablock value].  Alternatively, you
can just avoid inlining #ifTrue: in this case:

diff --git a/packages/stinst/parser/STCompiler.st 
b/packages/stinst/parser/STCompiler.st
index 620e019..4235d41 100644
--- a/packages/stinst/parser/STCompiler.st
+++ b/packages/stinst/parser/STCompiler.st
@@ -795,6 +795,7 @@ indexed'' bytecode. The resulting stream is
        | bc1 ret1 bc2 selector |
        aNode arguments do: 
                [:each | 
+               each isBlock ifFalse: [^false].
                (each arguments isEmpty and: [each body temporaries isEmpty]) 
                    ifFalse: [^false].
                bc1 isNil 

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]