haxe
haxe copied to clipboard
infinite loop in EReg.map()
This seems to cause an infinite loop on PHP. The "a0" character probably came from a mysql import.
class Eregtest {
public static function main():Void {
final hex = "7b7b706f7274616c2e6e616d657d7d2220636c6173733d22746578742d6461726b223e3c7370616e20636c6173733d226661732066612d70686f6e65223e3c2f7370616e3ea0207b7b70686f6e652e6e756d6265727d7d3c2f613e3c2f703e0d0a3c2f616464726573733e";
final text = php.Global.hex2bin(hex);
trace(text);
trace(~/\{\{(.*?)\}\}/g.map(text, (r) -> "huh"));
}
}