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

[SR-7369] Invalid InsertValueInst operands #49917

Closed
swift-ci opened this issue Apr 6, 2018 · 4 comments
Closed

[SR-7369] Invalid InsertValueInst operands #49917

swift-ci opened this issue Apr 6, 2018 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software IRGen LLVM IR generation

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 6, 2018

Previous ID SR-7369
Radar rdar://problem/39239510
Original Reporter linqingmo (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 9.3

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, IRGen
Assignee @aschwaighofer
Priority Medium

md5: f50b63b8f32ea006326e661c1c87adae

is duplicated by:

  • SR-7407 Unowned reference to a protocol composition type with NSObject causes crash

Issue Description:

import Foundation

protocol TestP: class {}

class TestC {
    unowned let t: NSObject & TestP // crash
    // weak var t: (NSObject & TestP)? is OK
    init(t: NSObject & TestP) {
        self.t = t
    }
}

 %12 = insertvalue { %TSo8NSObjectC*, i8** } undef, %objc_object* %8, 0, !dbg !64
<unknown>:0: error: fatal error encountered during compilation; please file a bug report with your project and the crash log
<unknown>:0: note: Broken function found, compilation aborted!
0  swift                    0x0000000103ad4ffa PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x0000000103ad43b6 SignalHandler(int) + 966
2  libsystem_platform.dylib 0x00007fff6d0a4f5a _sigtramp + 26
3  swift                    0x000000010444b900 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU32BitRegs + 103838
4  libsystem_c.dylib        0x00007fff6ce421ae abort + 127
5  swift                    0x000000010012b8e7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_0::__invoke(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 519
6  swift                    0x0000000103a8c658 llvm::report_fatal_error(llvm::Twine const&, bool) + 280
7  swift                    0x0000000103a8c539 llvm::report_fatal_error(char const*, bool) + 41
8  swift                    0x0000000103a54ca6 (anonymous namespace)::VerifierLegacyPass::runOnFunction(llvm::Function&) + 54
9  swift                    0x00000001039fc7d1 llvm::FPPassManager::runOnFunction(llvm::Function&) + 449
10 swift                    0x0000000103a04703 llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) + 115
11 swift                    0x0000000103a045fc llvm::legacy::FunctionPassManager::run(llvm::Function&) + 396
12 swift                    0x00000001002d4a18 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 5096
13 swift                    0x000000010013677d performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 44685
14 swift                    0x0000000100129e64 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7908
15 swift                    0x00000001000de8b5 main + 18917
16 libdyld.dylib            0x00007fff6cd96015 start + 1
@belkadan
Copy link
Contributor

belkadan commented Apr 6, 2018

With assertions:

Assertion failed: (ExtractValueInst::getIndexedType(Agg->getType(), Idxs) == Val->getType() && "Inserted value must match indexed type!"), function init, file /Volumes/Data/swift-public/llvm/lib/IR/Instructions.cpp, line 1916.

@slavapestov, is this another representational issue? Why would it work for weak but not unknown?

@swift-ci create

@slavapestov
Copy link
Member

This should work. It's just a straight up bug.

@aschwaighofer
Copy link
Member

#15846

@aschwaighofer
Copy link
Member

Merged fix into master #15846

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software IRGen LLVM IR generation
Projects
None yet
Development

No branches or pull requests

5 participants