diff options
author | 2013-12-12 00:17:43 +0100 | |
---|---|---|
committer | 2013-12-12 00:17:43 +0100 | |
commit | 9427726a6c8454c06934974262917a33cdf5f9f5 (patch) | |
tree | 5b3f7c68d7486298552317d1bf60c6fa5f592eab /Source/Core/AbsyType.cs | |
parent | 42b80a61e83e8d569700340ee9ad8f8aa3a270a8 (diff) |
Resolve a concurrency issue (reported by Alex Summers).
Diffstat (limited to 'Source/Core/AbsyType.cs')
-rw-r--r-- | Source/Core/AbsyType.cs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/Core/AbsyType.cs b/Source/Core/AbsyType.cs index 5274a20b..4efe1aea 100644 --- a/Source/Core/AbsyType.cs +++ b/Source/Core/AbsyType.cs @@ -2950,9 +2950,13 @@ Contract.Requires(that != null); if (subst.Count == 0)
return this;
List<Type> newArgs = new List<Type>();
- foreach (Type/*!*/ t in Arguments) {
- Contract.Assert(t != null);
- newArgs.Add(t.Substitute(subst));
+ lock (Arguments)
+ {
+ foreach (Type/*!*/ t in Arguments)
+ {
+ Contract.Assert(t != null);
+ newArgs.Add(t.Substitute(subst));
+ }
}
return new CtorType(tok, Decl, newArgs);
}
@@ -3336,9 +3340,13 @@ Contract.Assert(var != null); }
List<Type> newArgs = new List<Type>();
- foreach (Type/*!*/ t in Arguments) {
- Contract.Assert(t != null);
- newArgs.Add(t.Substitute(subst));
+ lock (Arguments)
+ {
+ foreach (Type/*!*/ t in Arguments)
+ {
+ Contract.Assert(t != null);
+ newArgs.Add(t.Substitute(subst));
+ }
}
Type/*!*/ newResult = Result.Substitute(subst);
Contract.Assert(newResult != null);
|