Skip to content

Using cppia, jit and type parameters produces incorrect arithmetic #926

@dburburan

Description

@dburburan

Tested with nightly haxe_20200726120142_c9408747b + hxcpp commit f605dc from 2020-07-16
Also tested in Haxe 4.1.2 and hxcpp 4.1.15.

Main.hx :

class Wrapper<T> {
  public var x : T;
  public function new (v:T) x = v;
}

class Main {
  static function main () {
    var w = new Wrapper<Int>(5);
    trace (w.x);
    w.x *= 3;
    trace (w.x);
  }
}

Compile and run with

haxe -main Main -cppia out.cppia
haxelib run hxcpp out.cppia -jit

Expected to trace Main.hx:11: 15 instead traces a nonsense number:

Main.hx:9: 5
Main.hx:11: 3.2315674346891e-311

Thanks,
David

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions