Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE: Module validation failed: Invalid bitcast #8198

Closed
Sija opened this issue Sep 18, 2019 · 2 comments
Closed

ICE: Module validation failed: Invalid bitcast #8198

Sija opened this issue Sep 18, 2019 · 2 comments
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler

Comments

@Sija
Copy link
Contributor

Sija commented Sep 18, 2019

Code below:

class Object
  def to_foo(io); end

  def to_foo
    String.build &->to_foo(IO)
  end
end

Time.local.to_foo # for structs works fine apparently
:foobar.to_foo  # ... but it crashes having simple `Value`s as implicit `self`

generates following ICE:

Module validation failed: Invalid bitcast
  %6 = bitcast i32 %self to i8*
 (Exception)
  from Crystal::CodeGenVisitor#finish:Nil
  from Crystal::Compiler#codegen<Crystal::Program, Crystal::ASTNode+, Array(Crystal::Compiler::Source), String>:(Tuple(Array(Crystal::Compiler::CompilationUnit), Array(String)) | Nil)
  from Crystal::Compiler#compile<Array(Crystal::Compiler::Source), String>:Crystal::Compiler::Result
  from Crystal::Command#run_command<Bool>:Nil
  from Crystal::Command#run:(Bool | Crystal::Compiler::Result | Nil)
  from main

See https://carc.in/#/r/7le1

@jhass jhass added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler labels Sep 19, 2019
@Sija Sija mentioned this issue Sep 20, 2019
@asterite
Copy link
Member

Related to #7577: you currently can't get a proc of a primitive (number, symbol, etc.) method

@HertzDevil
Copy link
Contributor

Cannot reproduce since 0.36. This is most likely fixed by #9824

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler
Projects
None yet
Development

No branches or pull requests

4 participants