smalltalk--backstage--2.2--patch-55
    fix stinst compilation of #ifFalse:#ifTrue:

Took a break from some Java stuff I'm working on, and found this when I
wrote a massive ifFalse block followed by a tiny ifTrue block.  The
wrong size was used in the optimized compilation, so

    condition ifFalse: [lots of code] ifTrue: [little code]

would jump way past the end after executing the ifFalse: block, making
for all sorts of madness.

This also includes an unrelated tiny NEWS fix.

-- 
;;; Stephen Compall ** http://scompall.nocandysw.com/blog **
"Peta" is Greek for fifth; a petabyte is 10 to the fifth power, as
well as fifth in line after kilo, mega, giga, and tera.
  -- Lee Gomes, performing every Wednesday in his tech column
     "Portals" on page B1 of The Wall Street Journal
2007-09-02  Stephen Compall <[EMAIL PROTECTED]>

	* packages/stinst/parser/STCompiler.st: Jump past true bytes
	after ifFalse: branch in #ifFalse:ifTrue:, not false bytes.

	* NEWS: Fix #join example.


--- orig/NEWS
+++ mod/NEWS
@@ -98,7 +98,7 @@
     Another methods meant to be used with the { ... } syntax is #join.
     For example
 
-        { 'hello'. a. '!' }
+        { 'hello'. a. '!' } join
 
     returns a string and is the same as using #, repeatedly, but is more
     efficient.


--- orig/packages/stinst/parser/STCompiler.st
+++ mod/packages/stinst/parser/STCompiler.st
@@ -854,7 +854,7 @@
     self compileJump: falseSize if: true.
     self nextPutAll: bcFalse.
     bcFalseReturns ifFalse: [
-	self compileByte: Jump arg: bcFalse size.
+	self compileByte: Jump arg: bcTrue size.
     ].
     self nextPutAll: bcTrue.
     ^true



Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to