HaxeFoundation / HaxeFoundation/hxcpp
Invalid cast succeeds and leads to crash
Open
- Dominant language
- C++
- Stars
- 330
- Forks
- 227
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 18
Description
Here is a simple class to reproduce the issue:
```
class HxcppBug
{
public static function main()
{
var s : String = "";
var c = try cast(s, Interface) catch (e : Dynamic) null;
if ((c == null) || c.foo) {
trace("Impossible");
}
}
}
private interface Interface
{
var foo(get, null) : Bool;
}
```
This program crashes. c should be evaluated to null, but is instead just assigned from s. Then the call to the get_foo() function crashes since there is no such function on String.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.