Return-Path: X-Original-To: apmail-groovy-notifications-archive@minotaur.apache.org Delivered-To: apmail-groovy-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 04AC318A27 for ; Fri, 7 Aug 2015 11:37:59 +0000 (UTC) Received: (qmail 28665 invoked by uid 500); 7 Aug 2015 11:37:49 -0000 Delivered-To: apmail-groovy-notifications-archive@groovy.apache.org Received: (qmail 28641 invoked by uid 500); 7 Aug 2015 11:37:49 -0000 Mailing-List: contact notifications-help@groovy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.incubator.apache.org Delivered-To: mailing list notifications@groovy.incubator.apache.org Received: (qmail 28632 invoked by uid 99); 7 Aug 2015 11:37:49 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2015 11:37:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id EFA00C027C for ; Fri, 7 Aug 2015 11:37:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.77 X-Spam-Level: * X-Spam-Status: No, score=1.77 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id WBl-yj9e_FMV for ; Fri, 7 Aug 2015 11:37:48 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id A8A9A27718 for ; Fri, 7 Aug 2015 11:37:46 +0000 (UTC) Received: (qmail 27266 invoked by uid 99); 7 Aug 2015 11:37:45 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2015 11:37:45 +0000 Date: Fri, 7 Aug 2015 11:37:45 +0000 (UTC) From: "Matias Bjarland (JIRA)" To: notifications@groovy.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GROOVY-7542) CompileStatic class generation bug "register with message: rightShiftUnsigned and arguments X" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/GROOVY-7542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14661692#comment-14661692 ] Matias Bjarland commented on GROOVY-7542: ----------------------------------------- An additional nugget of information on this issue. Pasting in my original (non simplified...kind of...left out the lengthy 'table' def) code: {code:language=groovy} @CompileStatic long crc64(File file) { long register = 0xfac432b10cd5e44aL def table = [] int KB = 1024 int MB = 1024*KB file.eachByte(MB) { byte[] buf, int bytesRead -> buf[0, bytesRead-1].each { long element -> long tmp = register int t = (int) (tmp >>> 56 ^ element) tmp <<= 8 tmp ^= table[t] register = tmp } } register } {code} assigning the variable 'register' to 'tmp' and then performing the shift operations on 'tmp' resolves the issue. Performing the operations directly on 'register' above causes the same error as in the issue description. > CompileStatic class generation bug "register with message: rightShiftUnsigned and arguments X" > ---------------------------------------------------------------------------------------------- > > Key: GROOVY-7542 > URL: https://issues.apache.org/jira/browse/GROOVY-7542 > Project: Groovy > Issue Type: Bug > Components: Static compilation > Affects Versions: 2.4.4 > Environment: Groovy Version: 2.4.4 JVM: 1.7.0_55 Vendor: Oracle Corporation OS: Linux > Reporter: Matias Bjarland > > Error caused by the following code snippet (was in the process of coding a crc64 algorithm): > {code:language=groovy} > import groovy.transform.CompileStatic > test() > @CompileStatic > def test() { > long register = 0xfac432b10cd5e44aL > > [1,2,3].each { int element -> > int t = (int) (register >>> 56 ^ (long) element) & 0xff > } > } > {code} > execution example: > {code} > $ groovy test.groovy > Caught: BUG! exception in phase 'class generation' in source unit '/home/mbjarland/test.groovy' At line 11 column 20 > On receiver: register with message: rightShiftUnsigned and arguments: 56 > This method should not have been called. Please try to create a simple example reproducing this error and filea bug report at https://issues.apache.org/jira/browse/GROOVY > BUG! exception in phase 'class generation' in source unit '/home/mbjarland/projects/kohler.project/projects/full-publish/test.groovy' At line 11 column 20 > On receiver: register with message: rightShiftUnsigned and arguments: 56 > This method should not have been called. Please try to create a simple example reproducing this error and filea bug report at https://issues.apache.org/jira/browse/GROOVY > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)