[jira] Created: (BOO-1251) Overflowing calculations with constants are compiled to invalid code

View: New views
7 Messages — Rating Filter:   Alert me  

[jira] Created: (BOO-1251) Overflowing calculations with constants are compiled to invalid code

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Overflowing calculations with constants are compiled to invalid code
--------------------------------------------------------------------

                 Key: BOO-1251
                 URL: http://jira.codehaus.org/browse/BOO-1251
             Project: Boo
          Issue Type: Bug
          Components: Compiler
         Environment: Boo 0.9.2.3383 on .NET 3.5 SP1
            Reporter: Daniel Grunwald
            Priority: Minor
             Fix For: 0.9.3


In booish, enter "1 << 0x22".

Expected result: 4 (due to integer overflow)
Actual result: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Compiling the code and running PEVerify reveals that the Boo compiler emitted invalid code.

[IL]: Error: [d:\Net\boo\bin\a.exe : AModule::Main][offset 0x00000009][found Long][expected Int32] Unexpected type on the stack.
1 Error Verifying a.exe

Everything works fine when using variables - the bug seems to be related to constant folding. The same error occurs for other integer calculations that cause overflows (e.g. multiplications).

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Assigned: (BOO-1251) Overflowing calculations with constants are compiled to invalid code

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/BOO-1251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rodrigo B. de Oliveira reassigned BOO-1251:
-------------------------------------------

    Assignee: Rodrigo B. de Oliveira

> Overflowing calculations with constants are compiled to invalid code
> --------------------------------------------------------------------
>
>                 Key: BOO-1251
>                 URL: http://jira.codehaus.org/browse/BOO-1251
>             Project: Boo
>          Issue Type: Bug
>          Components: Compiler
>         Environment: Boo 0.9.2.3383 on .NET 3.5 SP1
>            Reporter: Daniel Grunwald
>            Assignee: Rodrigo B. de Oliveira
>            Priority: Minor
>             Fix For: 0.9.3
>
>
> In booish, enter "1 << 0x22".
> Expected result: 4 (due to integer overflow)
> Actual result: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
> Compiling the code and running PEVerify reveals that the Boo compiler emitted invalid code.
> [IL]: Error: [d:\Net\boo\bin\a.exe : AModule::Main][offset 0x00000009][found Long][expected Int32] Unexpected type on the stack.
> 1 Error Verifying a.exe
> Everything works fine when using variables - the bug seems to be related to constant folding. The same error occurs for other integer calculations that cause overflows (e.g. multiplications).

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (BOO-1251) Overflowing calculations with constants are compiled to invalid code

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/BOO-1251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=191111#action_191111 ]

Cedric Vivier commented on BOO-1251:
------------------------------------

How do you reproduce when compiling the code?

I appropriately enough get "BCE0171: Constant value `17179869184L' cannot be converted to a `int'."





> Overflowing calculations with constants are compiled to invalid code
> --------------------------------------------------------------------
>
>                 Key: BOO-1251
>                 URL: http://jira.codehaus.org/browse/BOO-1251
>             Project: Boo
>          Issue Type: Bug
>          Components: Compiler
>         Environment: Boo 0.9.2.3383 on .NET 3.5 SP1
>            Reporter: Daniel Grunwald
>            Assignee: Rodrigo B. de Oliveira
>            Priority: Minor
>             Fix For: 0.9.3
>
>
> In booish, enter "1 << 0x22".
> Expected result: 4 (due to integer overflow)
> Actual result: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
> Compiling the code and running PEVerify reveals that the Boo compiler emitted invalid code.
> [IL]: Error: [d:\Net\boo\bin\a.exe : AModule::Main][offset 0x00000009][found Long][expected Int32] Unexpected type on the stack.
> 1 Error Verifying a.exe
> Everything works fine when using variables - the bug seems to be related to constant folding. The same error occurs for other integer calculations that cause overflows (e.g. multiplications).

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (BOO-1251) Overflowing calculations with constants are compiled to invalid code

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/BOO-1251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=191149#action_191149 ]

Daniel Grunwald commented on BOO-1251:
--------------------------------------

I compiled the one-line-program: print (1 << 0x22)

Interesting... when assigning the result of (1<<0x22) to a variable instead of printing it, I get BCE0171.

> Overflowing calculations with constants are compiled to invalid code
> --------------------------------------------------------------------
>
>                 Key: BOO-1251
>                 URL: http://jira.codehaus.org/browse/BOO-1251
>             Project: Boo
>          Issue Type: Bug
>          Components: Compiler
>         Environment: Boo 0.9.2.3383 on .NET 3.5 SP1
>            Reporter: Daniel Grunwald
>            Assignee: Rodrigo B. de Oliveira
>            Priority: Minor
>             Fix For: 0.9.3
>
>
> In booish, enter "1 << 0x22".
> Expected result: 4 (due to integer overflow)
> Actual result: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
> Compiling the code and running PEVerify reveals that the Boo compiler emitted invalid code.
> [IL]: Error: [d:\Net\boo\bin\a.exe : AModule::Main][offset 0x00000009][found Long][expected Int32] Unexpected type on the stack.
> 1 Error Verifying a.exe
> Everything works fine when using variables - the bug seems to be related to constant folding. The same error occurs for other integer calculations that cause overflows (e.g. multiplications).

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (BOO-1251) Overflowing calculations with constants are compiled to invalid code

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/BOO-1251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=191150#action_191150 ]

Cedric Vivier commented on BOO-1251:
------------------------------------

Hmm i guess this is macro-related, as BCE0171 is issued too when doing Console.WriteLine(1 << 0x22)


> Overflowing calculations with constants are compiled to invalid code
> --------------------------------------------------------------------
>
>                 Key: BOO-1251
>                 URL: http://jira.codehaus.org/browse/BOO-1251
>             Project: Boo
>          Issue Type: Bug
>          Components: Compiler
>         Environment: Boo 0.9.2.3383 on .NET 3.5 SP1
>            Reporter: Daniel Grunwald
>            Assignee: Rodrigo B. de Oliveira
>            Priority: Minor
>             Fix For: 0.9.3
>
>
> In booish, enter "1 << 0x22".
> Expected result: 4 (due to integer overflow)
> Actual result: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
> Compiling the code and running PEVerify reveals that the Boo compiler emitted invalid code.
> [IL]: Error: [d:\Net\boo\bin\a.exe : AModule::Main][offset 0x00000009][found Long][expected Int32] Unexpected type on the stack.
> 1 Error Verifying a.exe
> Everything works fine when using variables - the bug seems to be related to constant folding. The same error occurs for other integer calculations that cause overflows (e.g. multiplications).

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Issue Comment Edited: (BOO-1251) Overflowing calculations with constants are compiled to invalid code

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/BOO-1251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=191150#action_191150 ]

Cedric Vivier edited comment on BOO-1251 at 9/16/09 5:57 AM:
-------------------------------------------------------------

Hmm I guess the error not showing is macro-related, as BCE0171 is issued too when doing Console.WriteLine(1 << 0x22)

Of course it does not relate to the problem in the first place wrt the interpreter.



      was (Author: cedricv):
    Hmm i guess this is macro-related, as BCE0171 is issued too when doing Console.WriteLine(1 << 0x22)

 

> Overflowing calculations with constants are compiled to invalid code
> --------------------------------------------------------------------
>
>                 Key: BOO-1251
>                 URL: http://jira.codehaus.org/browse/BOO-1251
>             Project: Boo
>          Issue Type: Bug
>          Components: Compiler
>         Environment: Boo 0.9.2.3383 on .NET 3.5 SP1
>            Reporter: Daniel Grunwald
>            Assignee: Rodrigo B. de Oliveira
>            Priority: Minor
>             Fix For: 0.9.3
>
>
> In booish, enter "1 << 0x22".
> Expected result: 4 (due to integer overflow)
> Actual result: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
> Compiling the code and running PEVerify reveals that the Boo compiler emitted invalid code.
> [IL]: Error: [d:\Net\boo\bin\a.exe : AModule::Main][offset 0x00000009][found Long][expected Int32] Unexpected type on the stack.
> 1 Error Verifying a.exe
> Everything works fine when using variables - the bug seems to be related to constant folding. The same error occurs for other integer calculations that cause overflows (e.g. multiplications).

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Resolved: (BOO-1251) Overflowing calculations with constants are compiled to invalid code

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/BOO-1251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rodrigo B. de Oliveira resolved BOO-1251.
-----------------------------------------

    Resolution: Fixed

Fixed in revision 3405.

> Overflowing calculations with constants are compiled to invalid code
> --------------------------------------------------------------------
>
>                 Key: BOO-1251
>                 URL: http://jira.codehaus.org/browse/BOO-1251
>             Project: Boo
>          Issue Type: Bug
>          Components: Compiler
>         Environment: Boo 0.9.2.3383 on .NET 3.5 SP1
>            Reporter: Daniel Grunwald
>            Assignee: Rodrigo B. de Oliveira
>            Priority: Minor
>             Fix For: 0.9.3
>
>
> In booish, enter "1 << 0x22".
> Expected result: 4 (due to integer overflow)
> Actual result: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
> Compiling the code and running PEVerify reveals that the Boo compiler emitted invalid code.
> [IL]: Error: [d:\Net\boo\bin\a.exe : AModule::Main][offset 0x00000009][found Long][expected Int32] Unexpected type on the stack.
> 1 Error Verifying a.exe
> Everything works fine when using variables - the bug seems to be related to constant folding. The same error occurs for other integer calculations that cause overflows (e.g. multiplications).

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email