-
-
Notifications
You must be signed in to change notification settings - Fork 259
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 when providing mismatched _d_assert_msg() declaration #958
Comments
This is a nasty one. A call to
triggers the error message:
But the import for |
Are you sure? At first glance, the difference simply seems to be that the imported asserts would be codegen'd after the declaration, so instead of copying over the |
_d_assert_msg
declaration
_d_assert_msg
declarationThis fixes issue ldc-developers#958 by checking the function type of an existing function declaration with the same runtime function name inside the codegen'd module. This should normally be an existing forward declaration from a previous runtime call, but the user is free to declare (and even implement) it too. The LOC for the error is empty as the provided `loc` may likely be from a template instantiation from another module.
Seems like we forgot to close this. Failing now with a proper error msg: https://godbolt.org/g/1Wqm1u |
ldc2 -c -oq -od=/tmp/d08 fun.d
fun.d:
ldc2 --version
LDC - the LLVM D compiler (cf0589):
based on DMD v2.066.1 and LLVM 3.6.1
Default target: x86_64-apple-darwin14.3.0
Host CPU: core-avx2
0 ldc2 0x0000000104878ad1 llvm::sys::PrintStackTrace(sFILE) + 57
1 ldc2 0x0000000104879027 SignalHandler(int) + 217
2 libsystem_platform.dylib 0x00007fff9a658f1a sigtramp + 26
3 ldc2 0x0000000104c0ec36 nuls + 69742
4 ldc2 0x0000000104878eb6 abort + 22
5 ldc2 0x0000000104878ea0 abort + 0
6 ldc2 0x000000010480c0d8 llvm::CallInst::init(llvm::Value, llvm::Twine const&) + 0
7 ldc2 0x0000000103f38f99 llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter >::CreateCall(llvm::Value, llvm::ArrayRefllvm::Value_, llvm::Twine const&) + 201
8 ldc2 0x0000000103f3fbde llvm::CallSite IRState::CreateCallOrInvoke<llvm::SmallVector<llvm::Value*, 3u> >(llvm::Value_, llvm::SmallVector<llvm::Value_, 3u> const&, char const_) + 686
9 ldc2 0x0000000103f39af8 DtoAssert(Module_, Loc&, DValue_) + 312
10 ldc2 0x0000000103f7427b ToElemVisitor::visit(AssertExp_) + 763
11 ldc2 0x0000000103f70236 toElemDtor(Expression_) + 614
12 ldc2 0x0000000103f5f502 ToIRVisitor::visit(ExpStatement_) + 130
13 ldc2 0x0000000103f5f594 ToIRVisitor::visit(CompoundStatement_) + 116
14 ldc2 0x0000000103f5f3ee codegenFunction(Statement_, IRState_) + 190
15 ldc2 0x0000000103f35eee DtoDefineFunction(FuncDeclaration_) + 3982
16 ldc2 0x0000000103f2cf4f CodegenVisitor::visit(StructDeclaration_) + 223
17 ldc2 0x0000000103f2cd3f CodegenVisitor::visit(TemplateInstance_) + 143
18 ldc2 0x0000000103f2c352 Declaration_codegen(Dsymbol*) + 50
19 ldc2 0x0000000103f42ea6 Module::genLLVMModule(llvm::LLVMContext&) + 3206
20 ldc2 0x0000000103de260c main + 6044
21 libdyld.dylib 0x00007fff8c15d5c9 start + 1
22 libdyld.dylib 0x0000000000000011 start + 1944726089
The text was updated successfully, but these errors were encountered: