projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use MOONLIGHT symbol
[mono.git]
/
mcs
/
class
/
PEAPI
/
Code.cs
diff --git
a/mcs/class/PEAPI/Code.cs
b/mcs/class/PEAPI/Code.cs
index af8ae771cfa48247779c2f81463aa9719be4c282..60f09b4e92d2d185568506f47987d2632a797b1b 100644
(file)
--- a/
mcs/class/PEAPI/Code.cs
+++ b/
mcs/class/PEAPI/Code.cs
@@
-701,6
+701,7
@@
namespace PEAPI {
exceptions = new ArrayList();
else if (exceptions.Contains(tryBlock)) return;
exceptions.Add(tryBlock);
exceptions = new ArrayList();
else if (exceptions.Contains(tryBlock)) return;
exceptions.Add(tryBlock);
+ tryBlock.ResolveCatchBlocks (metaData);
}
/// <summary>
}
/// <summary>
@@
-975,6
+976,16
@@
namespace PEAPI {
return fatFormat;
}
return fatFormat;
}
+ //Hackish
+ internal void ResolveCatchBlocks (MetaData md)
+ {
+ for (int i=0; i < handlers.Count; i++) {
+ Catch c = handlers [i] as Catch;
+ if (c != null)
+ c.ResolveType (md);
+ }
+ }
+
internal override void Write(FileImage output, bool fatFormat)
{
// Console.WriteLine("writing exception details");
internal override void Write(FileImage output, bool fatFormat)
{
// Console.WriteLine("writing exception details");
@@
-1013,7
+1024,7
@@
namespace PEAPI {
/// </summary>
public class Catch : HandlerBlock {
/// </summary>
public class Catch : HandlerBlock {
-
Class
exceptType;
+
MetaDataElement
exceptType;
/// <summary>
/// Create a new catch clause
/// <summary>
/// Create a new catch clause
@@
-1021,12
+1032,23
@@
namespace PEAPI {
/// <param name="except">the exception to be caught</param>
/// <param name="handlerStart">start of the handler code</param>
/// <param name="handlerEnd">end of the handler code</param>
/// <param name="except">the exception to be caught</param>
/// <param name="handlerStart">start of the handler code</param>
/// <param name="handlerEnd">end of the handler code</param>
- public Catch(Class except, CILLabel handlerStart, CILLabel handlerEnd)
+ public Catch(Class except, CILLabel handlerStart, CILLabel handlerEnd)
+ : base(handlerStart, handlerEnd)
+ {
+ exceptType = except;
+ }
+
+ public Catch(Type except, CILLabel handlerStart, CILLabel handlerEnd)
: base(handlerStart,handlerEnd)
{
exceptType = except;
}
: base(handlerStart,handlerEnd)
{
exceptType = except;
}
+ internal void ResolveType (MetaData md)
+ {
+ exceptType = ((Type) exceptType).GetTypeSpec (md);
+ }
+
internal override void Write(FileImage output, bool fatFormat)
{
base.Write(output,fatFormat);
internal override void Write(FileImage output, bool fatFormat)
{
base.Write(output,fatFormat);
@@
-1274,10
+1296,17
@@
namespace PEAPI {
int tide = 0;
CILInstruction labInstr;
uint offset = 0;
int tide = 0;
CILInstruction labInstr;
uint offset = 0;
+ bool absolute;
- public CILLabel (uint offset)
+
+ public CILLabel (uint offset, bool absolute)
{
this.offset = offset;
{
this.offset = offset;
+ this.absolute = absolute;
+ }
+
+ public CILLabel (uint offset) : this (offset, false)
+ {
}
}
@@
-1310,6
+1339,7
@@
namespace PEAPI {
internal uint GetLabelOffset()
{
internal uint GetLabelOffset()
{
+ if (absolute) return offset;
if (labInstr == null) return 0;
return labInstr.offset + offset;
}
if (labInstr == null) return 0;
return labInstr.offset + offset;
}