diff core/src/luan/impl/LuanJavaCompiler.java @ 650:d658eab7bf4c

finish compiling operators
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 31 Mar 2016 22:43:51 -0600
parents e387e4021afe
children 067d9470184d
line wrap: on
line diff
--- a/core/src/luan/impl/LuanJavaCompiler.java	Wed Mar 30 22:42:27 2016 -0600
+++ b/core/src/luan/impl/LuanJavaCompiler.java	Thu Mar 31 22:43:51 2016 -0600
@@ -57,8 +57,8 @@
 		outer:
 		for( int i=0; true; i++ ) {
 			if( i > max )
-				throw new RuntimeException();
-			if( byteCode[i]==1 && byteCode[i+1]*256 + byteCode[i+2] == len ) {
+				throw new RuntimeException("len="+len);
+			if( byteCode[i]==1 && (byteCode[i+1] << 8 | 0xFF & byteCode[i+2]) == len ) {
 				for( int j=i+3; j<i+3+len; j++ ) {
 					if( byteCode[j] != '$' )
 						continue outer;