Files
swift-mirror/test/SILOptimizer/silcombine_runtime_crash.swift
Erik Eckstein 1072bb6bc6 SILCombine: fix a miscompile caused by dead-apply elimination
SILCombine ended up moving a strong_release past a dealloc_ref.
fixes https://bugs.swift.org/browse/SR-9627
rdar://problem/47153896
2019-01-14 09:00:00 -08:00

22 lines
410 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift -O %s -o %t/a.out
// RUN: %target-run %t/a.out | %FileCheck %s
// REQUIRES: executable_test
// This is an end-to-end test for SR-9627.
@inline(never)
func save(value: Double?) {
var params: [[String : Any]] = [["a": 0]]
params = [[
"b": 0,
"c": value.map({ String.init($0) }) as Any
]]
}
save(value: 0)
// CHECK: ok
print("ok")