HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.15k stars 657 forks source link

[C++] -D analyzer breaks `haxe.xml.Fast` and RTTI #4503

Closed RealyUniqueName closed 9 years ago

RealyUniqueName commented 9 years ago

To reproduce this bug, compile following class with haxe -main Test -cpp build -debug -D analyzer

class Test {
    static public function main () {
        var fast = new haxe.xml.Fast(Xml.parse("<class />"));
        fast.elements;
    }
}

Now run compiled file and see error:

Called from Test::main Test.hx line 4
Called from haxe.xml.Fast::get_elements /usr/lib/haxe/std/haxe/xml/Fast.hx line 165
Called from Xml::elements /usr/lib/haxe/std/Xml.hx line 232
Error : Null Object Reference

RTTI also becomes broken since it relies on haxe.xml.Fast.

Removing -D analyzer from compilation flags solves the problem (but removes compiler optimisations :) )

This bug affects C++ only. Other targets work fine. Compiler: Haxe 3.2.0 release.

nadako commented 9 years ago

This seems to be fixed in latest development version. Could you please test it on latest haxe?

RealyUniqueName commented 9 years ago

Yep, fixed in development version.