Author: raja
Date: 2006-01-13 01:19:54 -0500 (Fri, 13 Jan 2006)
New Revision: 55492
Modified:
trunk/mcs/errors/known-issues-gmcs
trunk/mcs/gmcs/
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/cfold.cs
trunk/mcs/gmcs/codegen.cs
trunk/mcs/gmcs/expression.cs
trunk/mcs/gmcs/iterators.cs
trunk/mcs/gmcs/typemanager.cs
trunk/mcs/tests/known-issues-gmcs
Log:
*** merge revisions from mcs: 55367, 55370, 55372, 55427, 55460
Modified: trunk/mcs/errors/known-issues-gmcs
===================================================================
--- trunk/mcs/errors/known-issues-gmcs 2006-01-13 05:48:19 UTC (rev 55491)
+++ trunk/mcs/errors/known-issues-gmcs 2006-01-13 06:19:54 UTC (rev 55492)
@@ -11,7 +11,6 @@
# csXXXX.cs NO ERROR : error test case doesn't report any error. An
exception is considered
# as NO ERROR and CS5001 is automatically ignored.
-cs0023-3.cs NO ERROR
cs0229-2.cs
cs0229.cs NO ERROR
cs0231-2.cs
Property changes on: trunk/mcs/gmcs
___________________________________________________________________
Name: gmcs
- Latest GMCS merging status:
- merged everything until r55226 (on 2006-01-09).
- not merging r49122, ie. we're keeping r48609 and r48610; see #75925.
- r37007 will never be merged; it's a mcs-only change.
- r43124 doesn't work in GMCS; not merged yet.
+ Latest GMCS merging status:
- merged everything until r55462 (on 2006-01-13).
- not merging r49122, ie. we're keeping r48609 and r48610; see #75925.
- r37007 will never be merged; it's a mcs-only change.
- r43124 doesn't work in GMCS; not merged yet.
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2006-01-13 05:48:19 UTC (rev 55491)
+++ trunk/mcs/gmcs/ChangeLog 2006-01-13 06:19:54 UTC (rev 55492)
@@ -1,3 +1,41 @@
+2006-01-12 Miguel de Icaza <[EMAIL PROTECTED]>
+
+ This fixes the problem where we used ldfld instead of ldflda to
+ load the "THIS" pointer on captured parameters, when THIS is a
+ value type. See bug #77205.
+
+ * iterators.cs (CapturedThisReference.Emit): Pass false to
+ EmitThis (we do not need the address).
+
+ * codegen.cs (EmitThis): it needs to know whether we need the
+ address of `this' or not. This is used by value types.
+
+ * expression.cs (This.AddressOf): Pass true to the EmitThis call,
+ every other call passes false.
+
+2006-01-12 Raja R Harinath <[EMAIL PROTECTED]>
+
+ Fix #77221.
+ * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
+ GetOverride.
+ * expression.cs (Invocation.OverloadResolve): Update.
+ (Invocation.DoResolve): Avoid double resolution of invocation.
+
+2006-01-11 Raja R Harinath <[EMAIL PROTECTED]>
+
+ Fix #77180.
+ * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
+ unary negation of floating point types as 0-expr; negation cannot
+ overflow in floating point types.
+
+ Fix #77204.
+ * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
+ on operands of 'void' type.
+
+ Fix #77200.
+ * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
+ and ExclusiveOr for boolean constants too.
+
2006-01-12 Ben Maurer <[EMAIL PROTECTED]>
* expression.cs: Fix Console.WriteLine ((this = x).foo);
Modified: trunk/mcs/gmcs/cfold.cs
===================================================================
--- trunk/mcs/gmcs/cfold.cs 2006-01-13 05:48:19 UTC (rev 55491)
+++ trunk/mcs/gmcs/cfold.cs 2006-01-13 06:19:54 UTC (rev 55492)
@@ -202,6 +202,23 @@
right = ((EnumConstant) right).Child;
}
+ if (left is BoolConstant && right is BoolConstant) {
+ bool lv = ((BoolConstant) left ).Value;
+ bool rv = ((BoolConstant) right).Value;
+ switch (oper) {
+ case Binary.Operator.BitwiseAnd:
+ case Binary.Operator.LogicalAnd:
+ return new BoolConstant (lv && rv,
left.Location);
+ case Binary.Operator.BitwiseOr:
+ case Binary.Operator.LogicalOr:
+ return new BoolConstant (lv || rv,
left.Location);
+ case Binary.Operator.ExclusiveOr:
+ return new BoolConstant (lv ^ rv,
left.Location);
+ default:
+ throw new InternalErrorException
("Invalid operator on booleans: " + oper);
+ }
+ }
+
Type wrap_as;
Constant result = null;
switch (oper){
@@ -998,22 +1015,6 @@
Binary.Error_OperatorCannotBeApplied (loc,
">>", lt, rt);
break;
- case Binary.Operator.LogicalAnd:
- if (left is BoolConstant && right is
BoolConstant){
- return new BoolConstant (
- ((BoolConstant) left).Value &&
- ((BoolConstant) right).Value,
left.Location);
- }
- break;
-
- case Binary.Operator.LogicalOr:
- if (left is BoolConstant && right is
BoolConstant){
- return new BoolConstant (
- ((BoolConstant) left).Value ||
- ((BoolConstant) right).Value,
left.Location);
- }
- break;
-
case Binary.Operator.Equality:
if (left is BoolConstant && right is
BoolConstant){
return new BoolConstant (
Modified: trunk/mcs/gmcs/codegen.cs
===================================================================
--- trunk/mcs/gmcs/codegen.cs 2006-01-13 05:48:19 UTC (rev 55491)
+++ trunk/mcs/gmcs/codegen.cs 2006-01-13 06:19:54 UTC (rev 55492)
@@ -910,7 +910,7 @@
// Emits the proper object to address fields on a remapped
// variable/parameter to field in anonymous-method/iterator
proxy classes.
//
- public void EmitThis ()
+ public void EmitThis (bool need_address)
{
ig.Emit (OpCodes.Ldarg_0);
if (capture_context != null && CurrentAnonymousMethod
!= null){
@@ -919,7 +919,10 @@
if (si.ParentLink != null)
ig.Emit (OpCodes.Ldfld,
si.ParentLink);
if (si.THIS != null){
- ig.Emit (OpCodes.Ldfld,
si.THIS);
+ if (need_address &&
TypeManager.IsValueType (si.THIS.FieldType))
+ ig.Emit
(OpCodes.Ldflda, si.THIS);
+ else
+ ig.Emit (OpCodes.Ldfld,
si.THIS);
break;
}
si = si.ParentScope;
Modified: trunk/mcs/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs 2006-01-13 05:48:19 UTC (rev 55491)
+++ trunk/mcs/gmcs/expression.cs 2006-01-13 06:19:54 UTC (rev 55492)
@@ -615,7 +615,7 @@
throw new Exception ("This should be caught by
Resolve");
case Operator.UnaryNegation:
- if (ec.CheckState) {
+ if (ec.CheckState && type !=
TypeManager.float_type && type != TypeManager.double_type) {
ig.Emit (OpCodes.Ldc_I4_0);
if (type == TypeManager.int64_type)
ig.Emit (OpCodes.Conv_U8);
@@ -4701,7 +4701,7 @@
if (candidate_overrides == null)
candidate_overrides =
new ArrayList ();
candidate_overrides.Add (m);
- m = TypeManager.GetOverride (m);
+ m =
TypeManager.TryGetBaseDefinition (m);
}
if (m != null)
methods [j++] = m;
@@ -5080,8 +5080,13 @@
return true;
}
+ private bool resolved = false;
public override Expression DoResolve (EmitContext ec)
{
+ if (resolved)
+ return this.method == null ? null : this;
+
+ resolved = true;
//
// First, resolve the expression that is used to
// trigger the invocation
@@ -5121,7 +5126,7 @@
}
MethodGroupExpr mg = (MethodGroupExpr) expr;
- method = OverloadResolve (ec, mg, Arguments, false,
loc);
+ MethodBase method = OverloadResolve (ec, mg, Arguments,
false, loc);
if (method == null)
return null;
@@ -5178,6 +5183,7 @@
mg.InstanceExpression.CheckMarshallByRefAccess
(ec.ContainerType);
eclass = ExprClass.Value;
+ this.method = method;
return this;
}
@@ -6849,7 +6855,7 @@
ILGenerator ig = ec.ig;
if (ec.TypeContainer is Struct){
- ec.EmitThis ();
+ ec.EmitThis (false);
source.Emit (ec);
LocalTemporary t = null;
@@ -6872,7 +6878,7 @@
{
ILGenerator ig = ec.ig;
- ec.EmitThis ();
+ ec.EmitThis (false);
if (ec.TypeContainer is Struct)
ig.Emit (OpCodes.Ldobj, type);
}
@@ -6893,7 +6899,7 @@
public void AddressOf (EmitContext ec, AddressOp mode)
{
- ec.EmitThis ();
+ ec.EmitThis (true);
// FIMXE
// FIGURE OUT WHY LDARG_S does not work
@@ -7284,6 +7290,11 @@
return null;
}
+ if (expr_type == TypeManager.void_type) {
+ Error (23, "The `.' operator can not be applied
to operands of type 'void'");
+ return null;
+ }
+
Expression member_lookup;
member_lookup = MemberLookup (
ec, expr_type, expr_type, Identifier, loc);
Modified: trunk/mcs/gmcs/iterators.cs
===================================================================
--- trunk/mcs/gmcs/iterators.cs 2006-01-13 05:48:19 UTC (rev 55491)
+++ trunk/mcs/gmcs/iterators.cs 2006-01-13 06:19:54 UTC (rev 55492)
@@ -951,7 +951,7 @@
public override void Emit (EmitContext ec)
{
- ec.EmitThis ();
+ ec.EmitThis (false);
}
}
Modified: trunk/mcs/gmcs/typemanager.cs
===================================================================
--- trunk/mcs/gmcs/typemanager.cs 2006-01-13 05:48:19 UTC (rev 55491)
+++ trunk/mcs/gmcs/typemanager.cs 2006-01-13 06:19:54 UTC (rev 55492)
@@ -1787,7 +1787,7 @@
(m is MethodBuilder || method_overrides.Contains (m));
}
- static public MethodBase GetOverride (MethodBase m)
+ static public MethodBase TryGetBaseDefinition (MethodBase m)
{
return (MethodBase) method_overrides [m];
}
Modified: trunk/mcs/tests/known-issues-gmcs
===================================================================
--- trunk/mcs/tests/known-issues-gmcs 2006-01-13 05:48:19 UTC (rev 55491)
+++ trunk/mcs/tests/known-issues-gmcs 2006-01-13 06:19:54 UTC (rev 55492)
@@ -10,8 +10,5 @@
test-xml-027.cs
test-465.cs IGNORE # need to fix the path separator to work both on Unix
and Windows
test-476.cs
-test-484.cs
-test-485.cs IGNORE
-test-486.cs
gtest-230.cs
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches