@@ -17,6 +17,7 @@
jvm : fixed multiplication of `Null<Float>` and `Int` (#9870)
flash : fixed loading swc libraries containing `Vector` without a type parameter (#9805)
hl : fixed messages being send to wrong threads with `sendMessage`/`readMessage` in `sys.thread.Thread` (#9875)
+ cpp : fixed `cpp.Lib.stringReference()` (#8457)
2020-07-22 4.1.3
@@ -88,7 +88,7 @@ class Lib {
public static function stringReference(inBytes:haxe.io.Bytes):String {
var result:String = "";
- untyped __global__.__hxcpp_string_of_bytes(inBytes.b, result, 0, 0, true);
+ untyped __global__.__hxcpp_string_of_bytes(inBytes.b, result, 0, inBytes.length, true);
return result;
}
@@ -0,0 +1,12 @@
+package unit.issues;
+
+class Issue8457 extends unit.Test {
+#if cpp
+ function test() {
+ var content = 'Hello world, testing, 1, 2, 3...';
+ var bytes = haxe.io.Bytes.ofString(content);
+ var s = cpp.Lib.stringReference(bytes);
+ eq(content, s);
+ }
+#end
+}