[Mono-dev] mcs patch to report Const location
marek.safar at seznam.cz
Thu Aug 18 12:57:48 EDT 2005
>>> I noticed that mcs does not report locations for constants. The
>>> attached patch fixes this matter. The patch is pretty massive
>>> (as I had to compress it), but the fixes are pretty simple - I
>>> just added Location parameter to everywhere BlahConstant is
>> Unfortunately not for constants only. Could you make diff against mcs
>> SVN HEAD version ?
> The patch got out of date (just in two days after) - anyways
> attached the patch for the latest head.
Oups, something is wrong I got it today.
However, not sure about this patch. I am not convinced about usefulness
of this patch. On several places this location doesn't make any sense.
+ public static Constant Constantify (Type t, Location loc)
This method converts 'new int()' syntax not zero constant. I think if
someone uses this location it is mcs coding error because it is not real
In similar way here
public override Constant Increment ()
- return new ByteConstant (checked ((byte)(Value + 1)));
+ return new ByteConstant (checked ((byte)(Value + 1)), loc);
Returned constant is not real constant (it doesn't have any reference to
source code) it is more like operator.
>>> BTW I noticed that compiler-tester does not work fine for libs
>>> and partial sources - maybe someone missed to commit it?
>> Could you be more specific ?
> It stops at *-lib.cs, saying below:
> test-317.cs... OK
> test-318.cs... OK
> Unhandled Exception: System.NullReferenceException: Object reference
> not set to an instance of an object
> in [0x00020] (at
> TestRunner.PositiveChecker:ExecuteFile (System.Reflection.MethodInfo
> entry_point, System.String filename)
> in [0x00147] (at
> TestRunner.PositiveChecker:Check (System.String filename)
> in [0x0006c] (at
> TestRunner.Checker:Do (System.String filename)
> in [0x00150] (at
> TestRunner.Tester:Main (System.String args)
> make: *** [run-test-local] Error 1
> make: Leaving directory `/home/atsushi/svn/mcs/tests'
> make: *** [do-run-test] Error 1
> The attached workaround (not a fix) lets run-test completed, but
> it still reports below:
> The latest changes caused regression in 4 file(s)
> They happen even though I haven't made any changes.
This looks strange. Are you using mono or Microsoft runtime ?
More information about the Mono-devel-list