Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion std/hl/_std/StringBuf.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@
}

inline function __expand(need:Int):Void {
var nsize = (size * 3) >> 1;
var nsize = size + (size >> 1);
if (nsize < size)
nsize = 0x7FFF0000;
if (need > nsize)
nsize = need;
if (nsize <= size)
throw "StringBuf maximum capacity reached";
var b2 = new hl.Bytes(nsize);
b2.blit(0, b, 0, pos);
b = b2;
Expand Down
5 changes: 5 additions & 0 deletions tests/hlcode/src/Macro.hx
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ class Macro {
// Remove source line prefix from instruction lines: ".12 @0" → "@0"
trimmed = ~/^\.\d+[ \t]+/.replace(trimmed, "");

// Normalize dynset constant in "dynset 7[@159],0" → "dynset 7[@0],0"
trimmed = ~/\bdynset (\d+)\[@(\d+)\],(\d+)/.map(trimmed, function(r) {
return "dynset " + r.matched(1) + "[@" + getGlobalId("str_" + r.matched(2)) + "]," + r.matched(3);
});

// Normalize global IDs in "global R, G" (OGetGlobal): G is the global index
trimmed = ~/\bglobal (\d+), (\d+)/.map(trimmed, function(r) {
return "global " + r.matched(1) + ", " + getGlobalId(r.matched(2));
Expand Down
Loading