Skip to content

Auto-dereference crashes rustboot #112

Closed
@jyasskin

Description

@jyasskin

Compiling:

obj obT() {
  fn call() {
  }
}
fn foo(@obT o) {
  o.call();
}
fn main() {
}

crashes with:

Fatal error: exception Failure("get_element_ptr 1 on cell [ebp + 0x20]")
Raised at file "pervasives.ml", line 22, characters 22-33
Called from file "boot/me/trans.ml", line 3844, characters 16-64
Called from file "boot/me/trans.ml", line 3887, characters 49-75
Called from file "boot/me/trans.ml", line 3422, characters 38-63
Called from file "boot/me/trans.ml", line 4276, characters 14-92
Called from file "boot/me/trans.ml", line 4055, characters 6-26
Re-raised at file "boot/me/trans.ml", line 4072, characters 11-104
Called from file "array.ml", line 117, characters 31-48
Called from file "boot/me/trans.ml", line 1974, characters 4-36
Called from file "boot/me/trans.ml", line 4604, characters 4-20
Called from file "boot/me/trans.ml", line 4999, characters 4-39
Called from file "boot/me/semant.ml", line 1435, characters 4-17
Called from file "boot/me/semant.ml", line 1561, characters 4-50
Called from file "boot/me/walk.ml", line 134, characters 4-9
Called from file "hashtbl.ml", line 145, characters 8-13
Called from file "hashtbl.ml", line 148, characters 4-19
Called from file "boot/me/walk.ml", line 135, characters 4-15
Called from file "array.ml", line 130, characters 31-51
Called from file "boot/driver/session.ml", line 60, characters 10-17
Called from file "boot/me/semant.ml", line 1861, characters 8-84
Called from file "boot/driver/main.ml", line 322, characters 9-26
Called from file "array.ml", line 117, characters 31-48
Called from file "boot/driver/main.ml", line 320, characters 4-366
Called from file "boot/driver/main.ml", line 404, characters 5-21

Changing foo to use "(*o).call();" avoids the crash.

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