Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs/ilasm
diff options
context:
space:
mode:
authorAnkit Jain <radical@corewars.org>2008-06-02 03:06:37 +0400
committerAnkit Jain <radical@corewars.org>2008-06-02 03:06:37 +0400
commit832218ea3ca129ac244175eb6c45940e60fc5a48 (patch)
treeea28e04a52c3e2b598388913b70107bd0514b859 /mcs/ilasm
parent169c1ff0f6e24d97a757d67ac8971a386116c846 (diff)
Fix bug #367114.
In class/PEAPI: Fix bug #367114. * Code.cs (TryBlock.ResolveCatchBlocks): New. (CILInstructions.AddTryBlock): Resolve the catch blocks with the new method. (Catch..ctor): Add new .ctor to allow exceptions of any type. (Catch.ResolveType): New. Add the exception type to the metadata. In ilasm/codegen: Fix bug #367114. * CatchBlock.cs: Allow exception to be of any type (BaseTypeRef) and not just a class (BaseClassRef). In ilasm/parser: Part of fix for bug #367114. * ILParser.jay (seh_clause): Allow exception to be of any type and not just class. svn path=/trunk/mcs/; revision=104636
Diffstat (limited to 'mcs/ilasm')
-rw-r--r--mcs/ilasm/codegen/CatchBlock.cs10
-rw-r--r--mcs/ilasm/codegen/ChangeLog6
-rw-r--r--mcs/ilasm/parser/ChangeLog6
-rw-r--r--mcs/ilasm/parser/ILParser.jay4
4 files changed, 19 insertions, 7 deletions
diff --git a/mcs/ilasm/codegen/CatchBlock.cs b/mcs/ilasm/codegen/CatchBlock.cs
index 6fc78c4fa37..ecc61b384e6 100644
--- a/mcs/ilasm/codegen/CatchBlock.cs
+++ b/mcs/ilasm/codegen/CatchBlock.cs
@@ -15,12 +15,12 @@ namespace Mono.ILASM {
public class CatchBlock : ISehClause {
- private BaseClassRef class_ref;
+ private BaseTypeRef type_ref;
private HandlerBlock handler_block;
- public CatchBlock (BaseClassRef class_ref)
+ public CatchBlock (BaseTypeRef type_ref)
{
- this.class_ref = class_ref;
+ this.type_ref = type_ref;
}
public void SetHandlerBlock (HandlerBlock hb)
@@ -34,9 +34,9 @@ namespace Mono.ILASM {
PEAPI.CILLabel to = handler_block.GetToLabel (code_gen, method);
PEAPI.Catch katch;
- class_ref.Resolve (code_gen);
+ type_ref.Resolve (code_gen);
- katch = new PEAPI.Catch (class_ref.PeapiClass, from, to);
+ katch = new PEAPI.Catch (type_ref.PeapiType, from, to);
return katch;
}
diff --git a/mcs/ilasm/codegen/ChangeLog b/mcs/ilasm/codegen/ChangeLog
index a084e7e6f09..c9dde76fa96 100644
--- a/mcs/ilasm/codegen/ChangeLog
+++ b/mcs/ilasm/codegen/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-02 Ankit Jain <jankit@novell.com>
+
+ Fix bug #367114.
+ * CatchBlock.cs: Allow exception to be of any type (BaseTypeRef) and not
+ just a class (BaseClassRef).
+
2008-06-01 Ankit Jain <jankit@novell.com>
Fix bug #364580.
diff --git a/mcs/ilasm/parser/ChangeLog b/mcs/ilasm/parser/ChangeLog
index 567c2d791d8..ca5f768f1bb 100644
--- a/mcs/ilasm/parser/ChangeLog
+++ b/mcs/ilasm/parser/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-02 Ankit Jain <jankit@novell.com>
+
+ Part of fix for bug #367114.
+ * ILParser.jay (seh_clause): Allow exception to be of any type and not
+ just class.
+
2008-06-01 Ankit Jain <jankit@novell.com>
* ILParser.jay: Track api changes.
diff --git a/mcs/ilasm/parser/ILParser.jay b/mcs/ilasm/parser/ILParser.jay
index bf9820bc5ba..123e7ed7613 100644
--- a/mcs/ilasm/parser/ILParser.jay
+++ b/mcs/ilasm/parser/ILParser.jay
@@ -2298,12 +2298,12 @@ seh_clauses : seh_clause
}
;
-seh_clause : K_CATCH generic_class_ref handler_block
+seh_clause : K_CATCH type handler_block
{
if ($2.GetType () == typeof (PrimitiveTypeRef))
Report.Error ("Exception not be of a primitive type.");
- BaseClassRef type = (BaseClassRef) $2;
+ BaseTypeRef type = (BaseTypeRef) $2;
CatchBlock cb = new CatchBlock (type);
cb.SetHandlerBlock ((HandlerBlock) $3);
$$ = cb;