From 0ff49845a7789f353abfc404fcedd64a1e0fa3e5 Mon Sep 17 00:00:00 2001 From: Andy Li Date: Fri, 11 May 2018 17:57:42 +0800 Subject: [PATCH] fix hscript.Bytes with -D hscriptPos (close #64) --- .travis.yml | 1 + hscript/Bytes.hx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index d2df209..5fc20cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,6 +64,7 @@ script: haxe build.hxml && popd - haxe bin/build-interp.hxml + - haxe bin/build-interp.hxml -D hscriptPos - haxe bin/build-neko.hxml && neko bin/Test.n - haxe bin/build-js.hxml && node bin/Test.js - haxe bin/build-java.hxml && java -jar bin/Test.jar diff --git a/hscript/Bytes.hx b/hscript/Bytes.hx index 00dfe3f..149e800 100644 --- a/hscript/Bytes.hx +++ b/hscript/Bytes.hx @@ -251,6 +251,10 @@ class Bytes { function doDecode() : Expr { #if hscriptPos + if (bin.get(pin) == 255) { + pin++; + return null; + } var origin = doDecodeString(); var line = doDecodeInt(); return { e : _doDecode(), pmin : 0, pmax : 0, origin : origin, line : line };