-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 #15202
Comments
.map
on a macro Array.map
on a macro Array
Looks like the cause for this error is that the downcased |
Macro methods which return "fresh" values should have the location of the call that created them. Like in this example, the downased string should have it's location point to the call to Ones that act as getters, returning already existing values (may be duplicates, though), the location should be that of the original value (like in The former is probably much more common, so we could consider adding a catch-all in |
I suppose it's not really feasible to assume that every AST node will always have an associated location. Ideally that would be the case, but unless there's a hard rule to enforce that, it cannot be expected at 100%. Under that premise the compiler (or LLVM) should probably be able to gracefully handle missing location information. This affects only AST nodes that can lead to function calls, which is the case for Here are a couple of ideas:
Unrelated to that, we should add location information to more AST nodes. I'll implement the suggestion from #15202 (comment). Here is the relevant code in LLVM: https://github.com/llvm/llvm-project/blob/aa746495affb3ab94daafcbe09bfb229dd27429f/llvm/lib/IR/Verifier.cpp#L3787-L3799 |
.map
on a macro Array
I've submitted a fix for the immediate problem with the code in the OP: #15213 |
Hi!
The following minimal example compiles and runs with
crystal run
, but results in a compiler error withcrystal run --release
The error
Removing
.map &.downcase
compiles correctly with--release
. Passing--no-debug
fixes it as well, obviously 🤣Relevant information:
Crystal 1.14.0 [dacd97b] (2024-10-09)
LLVM: 19.1.0
Default target: x86_64-redhat-linux-gnu
Fedora Linux 41
Edit:
Interestingly, if I'm not adding the elements to an array, it works.
The text was updated successfully, but these errors were encountered: