Author: martin
Date: 2007-10-05 08:36:58 -0400 (Fri, 05 Oct 2007)
New Revision: 86970
Modified:
trunk/debugger/frontend/Expression.cs
Log:
Don't crash here.
Modified: trunk/debugger/frontend/Expression.cs
===================================================================
--- trunk/debugger/frontend/Expression.cs 2007-10-05 12:24:21 UTC (rev
86969)
+++ trunk/debugger/frontend/Expression.cs 2007-10-05 12:36:58 UTC (rev
86970)
@@ -2429,13 +2429,13 @@
if (pexpr != null)
address = pexpr.EvaluateAddress
(context);
else {
- TargetPointerType ptype =
expr.EvaluateType (context)
- as TargetPointerType;
+ TargetType etype = expr.EvaluateType
(context);
+ TargetPointerType ptype = etype as
TargetPointerType;
if ((ptype == null) || ptype.IsTypesafe)
throw new ScriptingException (
"Cannot cast from {0}
to {1}.",
- ptype.Name,
target.Name);
+ etype.Name,
target.Name);
pexpr = new AddressOfExpression (expr);
pexpr.Resolve (context);
@@ -2449,6 +2449,7 @@
TargetClassType type = Convert.ToClassType
(target_type);
TargetClassObject source = Convert.ToClassObject (
context.CurrentThread, expr.EvaluateObject
(context));
+
if (source == null)
throw new ScriptingException (
"Variable {0} is not a class type.",
expr.Name);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches