https://forum.world.st/squeak-dev-Bug-with-valueWithReceiver-arguments-tp78494p78496.html
#primitiveResponse. If the latter does #primitiveFail, the now *two*
knowing from each other.
Perhaps #primitiveExecuteMethod should end with an explicit [ ... ^ self
not looked deeper).
looks like its arguments are no longer on the stack.
> Cheers,
> - Andreas
>
> Frederic Pluquet wrote:
>> Hello,
>> I found a fondamental bug in Squeak and Pharo. The next code
>> 11 / 2 gives the fraction (11/2). It's correct. But the next code
>> (SmallInteger>>#/) valueWithReceiver: 11 arguments: {2}
>> gives 1 !
>> The problem is the method valueWithReceiver:arguements: is used hugely
>> with method wrappers...
>> After long time of debugging, I found a point to debug: this method
>> don't have the good behavior with compiled methods having a primitive
>> that fails and executes some code after (as in SmallInteger>>#/ method
>> when the division don't give a whole integer). In fact, when I send
>> this message, the vm executes normally the compiled method but, in
>> place of returns simply the good result, seems to rerun the the
>> compiled method with other arguments (completly wrong) and returns so a
>> wrong result.
>> For example, (SmallInteger>>#/) valueWithReceiver: 11 arguments: {2}
>> has the following execution trace :
>> 2 isZero
>> | 2 = 0
>> | returns: false
>> returns: false
>> 2 isMemberOf: SmallInteger
>> | 2 class
>> | returns: SmallInteger
>> | SmallInteger == SmallInteger
>> | returns: true
>> returns: true
>> Fraction numerator: 101 denominator: 2
>> | Fraction new
>> | | Fraction basicNew
>> | | returns: a Fraction instance
>> | | (a Fraction instance) initialize
>> | | returns: a Fraction instance
>> | returns: a Fraction instance
>> | a Fraction instance setNumerator: 101 denominator: 2
>> | | 2 = 0
>> | | returns: false
>> | | 101 asInteger
>> | | returns: 101
>> | | 2 asInteger
>> | | returns: 2
>> | | 2 abs
>> | | | 2 < 0
>> | | | returns: false
>> | | returns: 2
>> | | 2 < 0
>> | | returns: false
>> | returns: (101/2)
>> returns: (101/2)
>> (101/2) reduced
>> | 101 = 0
>> | returns: false
>> | 101 gcd: 2
>> | | 101 = 0
>> | | returns: false
>> | | 2 \\ 101
>> | | returns: 2
>> | | 2 = 0
>> | | returns: false
>> | | 101 \\ 2
>> | | returns: 1
>> | | 1 = 0
>> | | returns: false
>> | | 2 \\ 1
>> | | returns: 0
>> | | 0 = 0
>> | | returns: true
>> | | 1 abs
>> | | | 1 < 0
>> | | | returns: false
>> | | returns: 1
>> | returns: 1
>> | 101 // 1
>> | returns: 101
>> | 2 // 1
>> | returns: 2
>> | 2 = 1
>> | returns: false
>> | Fraction numerator: 101 denominator: 2
>> | | Fraction new
>> | | | Fraction basicNew
>> | | | returns: a Fraction instance
>> | | | (a Fraction instance) initialize
>> | | | returns: a Fraction instance
>> | | returns: a Fraction instance
>> | | (a Fraction instance) setNumerator: 101 denominator: 2
>> | | | 2 = 0
>> | | | returns: false
>> | | | 101 asInteger
>> | | | returns: 101
>> | | | 2 asInteger
>> | | | returns: 2
>> | | | 2 abs
>> | | | | 2 < 0
>> | | | | returns: false
>> | | | returns: 2
>> | | | 2 < 0
>> | | | returns: false
>> | | returns: (101/2)
>> | returns: (101/2)
>> returns: (101/2)
>> 2 isZero
>> | 2 = 0
>> | returns: false
>> returns: false
>> false isMemberOf: SmallInteger
>> | false class
>> | returns: False
>> | False == SmallInteger
>> | returns: false
>> returns: false
>> Please help me to fix this bug. I really need it works fine !
>> Fréd
>> -- Frédéric Pluquet
>> Université Libre de Bruxelles (ULB)
>> Assistant
>>
http://www.ulb.ac.be/di/fpluquet>>
>> ------------------------------------------------------------------------
>>
>
>
>
“If at first, the idea is not absurd, then there is no hope for it”.