summaryrefslogtreecommitdiff
path: root/BCT
diff options
context:
space:
mode:
authorGravatar qadeer <qadeer@microsoft.com>2011-05-16 16:10:40 -0700
committerGravatar qadeer <qadeer@microsoft.com>2011-05-16 16:10:40 -0700
commit0d5d859e057952fbf38a1a706552b9663a7e8370 (patch)
tree50e99011723419188da948578da201f7149cef14 /BCT
parent9f52ea312a1d57859ef7ba0e131bca74817b637f (diff)
bug fixes
Diffstat (limited to 'BCT')
-rw-r--r--BCT/BytecodeTranslator/Sink.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/BCT/BytecodeTranslator/Sink.cs b/BCT/BytecodeTranslator/Sink.cs
index 852c3986..97fd4441 100644
--- a/BCT/BytecodeTranslator/Sink.cs
+++ b/BCT/BytecodeTranslator/Sink.cs
@@ -492,7 +492,7 @@ namespace BytecodeTranslator {
boogiePostcondition);
decl = proc;
}
- if (!TypeHelper.GetDefiningUnitReference(method.ContainingType).UnitIdentity.Equals(this.assemblyBeingTranslated.UnitIdentity)) {
+ if (this.assemblyBeingTranslated != null && !TypeHelper.GetDefiningUnitReference(method.ContainingType).UnitIdentity.Equals(this.assemblyBeingTranslated.UnitIdentity)) {
var attrib = new Bpl.QKeyValue(tok, "extern", new List<object>(1), null);
decl.Attributes = attrib;
}
@@ -617,6 +617,10 @@ namespace BytecodeTranslator {
t = this.Heap.CreateTypeVariable(type);
this.declaredTypes.Add(key, t);
this.TranslatedProgram.TopLevelDeclarations.Add(t);
+ if (this.assemblyBeingTranslated != null && !TypeHelper.GetDefiningUnitReference(type).UnitIdentity.Equals(this.assemblyBeingTranslated.UnitIdentity)) {
+ var attrib = new Bpl.QKeyValue(Bpl.Token.NoToken, "extern", new List<object>(1), null);
+ t.Attributes = attrib;
+ }
}
return t;
}
@@ -649,7 +653,7 @@ namespace BytecodeTranslator {
public void EndAssembly(IAssembly assembly) {
this.assemblyBeingTranslated = null;
}
- private IAssembly assemblyBeingTranslated;
+ private IAssembly/*?*/ assemblyBeingTranslated;
public Dictionary<ITypeDefinition, HashSet<IMethodDefinition>> delegateTypeToDelegates = new Dictionary<ITypeDefinition, HashSet<IMethodDefinition>>();