Browse Source

[eval] fix alloc-benchmarks

Simon Krajewski 5 years ago
parent
commit
d30eec230d
2 changed files with 4 additions and 1 deletions
  1. 1 1
      src/macro/eval/evalStdLib.ml
  2. 3 0
      std/haxe/io/Error.hx

+ 1 - 1
src/macro/eval/evalStdLib.ml

@@ -305,7 +305,7 @@ module StdBytes = struct
 		let pos = decode_int pos in
 		let len = decode_int len in
 		let value = decode_int value in
-		(try Bytes.fill this pos len (char_of_int value) with _ -> outside_bounds());
+		(try Bytes.fill this pos len (char_of_int (value land 0xFF)) with _ -> outside_bounds());
 		vnull
 	)
 

+ 3 - 0
std/haxe/io/Error.hx

@@ -25,6 +25,9 @@ package haxe.io;
 /**
 	The possible IO errors that can occur
 **/
+#if eval
+@:keep
+#end
 enum Error {
 	/** The IO is set into nonblocking mode and some data cannot be read or written **/
 	Blocked;