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

Module validation failed: inlinable function call in a function with debug info must have a !dbg location #4458

Closed
carsonbaker opened this issue May 24, 2017 · 1 comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler
Milestone

Comments

@carsonbaker
Copy link

Example code:

lib LibFoo
  struct Bar
    str : LibC::Char*
  end
end

shmee = LibFoo::Bar.new
shmee.str = "borkborkbork"

Execution:

 ± crystal build --release eek.cr
Module validation failed: inlinable function call in a function with debug info must have a !dbg location
  %77 = call i8* @"*String#to_unsafe:Pointer(UInt8)"(%String* bitcast ({ i32, i32, i32, [13 x i8] }* @"'borkborkbork'" to %String*))

0x10f633743: *raise<String>:NoReturn at ??
0x110613a6b: *Crystal::CodeGenVisitor#finish:Nil at ??
0x11053f03e: *Crystal::Compiler#codegen<Crystal::Program, Crystal::ASTNode+, Array(Crystal::Compiler::Source), String>:(Tuple(Array(Crystal::Compiler::CompilationUnit), Array(String)) | Nil) at ??
0x110de3764: *Crystal::Compiler#compile<Array(Crystal::Compiler::Source), String>:Crystal::Compiler::Result at ??
0x10f6a0aeb: *Crystal::Command#run:(Bool | Crystal::Compiler::Result | IO::FileDescriptor | Nil) at ??
0x10f66cb9d: main at ??

Environment:

 ± crystal -v
Crystal 0.22.0 (2017-04-20) LLVM 4.0.0
@faustinoaq
Copy link
Contributor

I can reproduce this.

If you use crystal build --release --no-debug eek.cr it compiles well

@mverzilli mverzilli added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler labels May 25, 2017
@asterite asterite added this to the Next milestone Jun 3, 2017
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