Files
swift-mirror/validation-test/ClangImporter/macros-repeatedly-redefined.swift
Jordan Rose 3717fe600c [ClangImporter] Fix use-after-free in macro importing (#12316)
This has been showing up as nondeterministic failures on our Linux
bots in the clang_builtins.swift test, because that test used to
trigger typo correction! Which pulled in macros, which happened to
include some redefinitions, which resulted in this.

rdar://problem/34266952
2017-10-06 18:20:40 -07:00

14 lines
353 B
Swift

// RUN: %target-swift-frontend -sdk "" -I %S/Inputs/macros-repeatedly-redefined -typecheck %s -verify
// This used to result in a use-after-free because the SmallVector holding the
// macros was reallocated.
import A
import B
import C
import D
import E
import F
_ = REDEFINED // no-warning
_ = x // expected-error {{use of unresolved identifier 'x'}}