IronLanguages / main

Work for this repo has moved to https://github.com/IronLanguages/ironpython2
1.16k stars 347 forks source link

Arithmetic expression mixing int and float literals is not working in Windows Phone #992

Open ironpythonbot opened 9 years ago

ironpythonbot commented 9 years ago

The expression 2 + 2 is successfully evaluated, but 2 + 2.5 crashes the app.

The expression 2.5 + 2.5 is evaluated successfully.

Please see the attached sample.

Work Item Details

Original CodePlex Issue: Issue 32374 Status: Active Reason Closed: Unassigned Assigned to: Unassigned Reported on: Mar 8, 2012 at 4:38 AM Reported by: cmello Updated on: Jun 26, 2013 at 6:31 AM Updated by: jdhardy

Binary Attachments

PhoneFloatDivision.zip

ironpythonbot commented 9 years ago

On 2012-03-08 12:39:59 UTC, cmello commented:

The exception thrown is ArgumentNullException. Stack trace:

at Microsoft.Scripting.Utils.ContractUtils.RequiresNotNull(Object value, String paramName)

at Microsoft.Scripting.Utils.CollectionUtils.FindIndex[T](IList1 collection, Predicate1 predicate)

at Microsoft.Scripting.Utils.ExceptionUtils.SetData(Exception e, Object key, Object value)

at Microsoft.Scripting.Interpreter.InterpretedFrame.SaveTraceToException(Exception exception)

at Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception)

at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](FunctionCode arg0) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run() at Microsoft.Scripting.SourceUnit.Execute() at Microsoft.Scripting.Hosting.ScriptSource.Execute() at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression) at PhoneFloatDivision.App.Application_Startup(Object sender, StartupEventArgs e) at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)

at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

ironpythonbot commented 9 years ago

On 2012-03-10 15:08:52 UTC, jdhardy commented:

The error given is not the root cause; it's a side effect of a bug in how unhandled exception are handled. Fixing that and another issue, the root cause is:

System.InvalidProgramException occurred Message=InvalidProgramException StackTrace: at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, Int32 arg0) at CallSite.Target() at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, Object arg0, Object arg1) at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](FunctionCode arg0) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run() at Microsoft.Scripting.SourceUnit.Execute() at Microsoft.Scripting.Hosting.ScriptSource.Execute() at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression) at PhoneFloatDivision.App.Application_Startup(Object sender, StartupEventArgs e) at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

Code generation bugs are not fun to fix.