mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILOptimizer: Re-implement NPCR diagnostics in SIL pass
This fixes a test involving transitive captures of local functions, as well as an infinite recursion possible with the old code. Fixes <rdar://problem/34496304>.
This commit is contained in:
@@ -137,6 +137,12 @@ NOTE(value_captured_here,none,"captured here", ())
|
||||
NOTE(value_captured_transitively,none,
|
||||
"captured indirectly by this call", ())
|
||||
|
||||
ERROR(err_noescape_param_call,none,
|
||||
"passing a %select{|closure which captures a }1non-escaping function "
|
||||
"parameter %0 to a call to a non-escaping function parameter can allow "
|
||||
"re-entrant modification of a variable",
|
||||
(DeclName, unsigned))
|
||||
|
||||
// Definite initialization diagnostics.
|
||||
NOTE(variable_defined_here,none,
|
||||
"%select{variable|constant}0 defined here", (bool))
|
||||
|
||||
Reference in New Issue
Block a user