[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] Re: [PATCH] Fix (3 perform: #~= with: 3.0)
From: |
Paolo Bonzini |
Subject: |
[Help-smalltalk] Re: [PATCH] Fix (3 perform: #~= with: 3.0) |
Date: |
Mon, 10 Dec 2007 08:55:25 +0100 |
User-agent: |
Thunderbird 2.0.0.9 (Macintosh/20071031) |
Paolo Bonzini wrote:
This stupid (almost embarrassing...) bug happens because, in the more
common idiom "3 ~= 3.0", the VM optimizes out the method calls. In the
case of the JIT however this does not happen, and this causes the
simpler idiom to fail as well (and the Complex package to fail the test
suite).
While not perfect, the testsuite results are good enough.
Ehm, the patch.
Paolo
2007-12-10 Paolo Bonzini <address@hidden>
* kernel/Number.st: Fix thinko in #retryInequalityCoercing:,
--- orig/kernel/Number.st
+++ mod/kernel/Number.st
@@ -252,8 +252,8 @@ implicit type coercing code for binary o
selfGen := self generality.
aNumGen := aNumber generality.
aNumGen isNil ifTrue: [^true].
- selfGen > aNumGen ifTrue: [^false == (self ~= (self coerce: aNumber))].
- selfGen < aNumGen ifTrue: [^false == ((aNumber coerce: self) ~=
aNumber)].
+ selfGen > aNumGen ifTrue: [^false == (self = (self coerce: aNumber))].
+ selfGen < aNumGen ifTrue: [^false == ((aNumber coerce: self) =
aNumber)].
self retryError
]