瀏覽代碼

fixed toNativeInt for Neko (no overflow)

Nicolas Cannasse 16 年之前
父節點
當前提交
4c308220fd
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      std/haxe/Int32.hx

+ 1 - 1
std/haxe/Int32.hx

@@ -57,7 +57,7 @@ class Int32 {
 
 
 	public static inline function toNativeInt( x : Int32 ) : Int {
 	public static inline function toNativeInt( x : Int32 ) : Int {
 		#if neko
 		#if neko
-		return try untyped __i32__to_int(x) catch( e : Dynamic ) throw "Overflow"+x;
+		return untyped (__i32__ushr(x,8) << 8) | __i32__and(x,0xFF);
 		#else
 		#else
 		return cast x;
 		return cast x;
 		#end
 		#end