From patchwork Tue Jul 8 20:50:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 368006 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43DA41400A3 for ; Wed, 9 Jul 2014 06:50:15 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=tK76Fd8ZmoIL4rjnjP+yhyClxENgolo1fmaUrfc2ExMSzjcX2n9LG a+44lVWSmWFJPozCmI4q8QnFkW8uDoMTtVe2/NDK+ainP0hLpBcndZaXgpEMnVDC G+d3SkxX7VHuuPWTXkN7mGkkEJmW4uaMwLiwlb35UuV0B4SARsk64o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=6ssPD/0UROqu0OdvrLuT9pNMoYI=; b=kAgZK2Woibq1uUSP2ndp IvhpoaRlQnoxAdKGG/L7FpN9w/Zk/4LsYc9GeCkJE4gEHACX3P3xdqBSLruvguz4 kqe/AGvNYhthh2itY1PymWpgGLpcjAnWy4DWe1PEbNqPuxYOJFUKWxpVDMPNWVJL 5L9EJNs5KM2jS1klK7SioOE= Received: (qmail 17104 invoked by alias); 8 Jul 2014 20:50:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 17087 invoked by uid 89); 8 Jul 2014 20:50:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS, T_TVD_MIME_NO_HEADERS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f54.google.com Received: from mail-pa0-f54.google.com (HELO mail-pa0-f54.google.com) (209.85.220.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 08 Jul 2014 20:50:05 +0000 Received: by mail-pa0-f54.google.com with SMTP id et14so7995980pad.27 for ; Tue, 08 Jul 2014 13:50:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=1Y5HbMJjSNCJs76TyHl+OCSjHUNMKJcApcB0YvpNfoI=; b=XzrSdayzdYQItVc1cjxM0naCwpBGqY1+dh2VGVZlke6PkwkYSv46FpzBo66BPWa+WH HR64Hs2F465k4ylZW3bV2ljjCj0OXZ5xtHY/KyjX0V34z/H9SiknVAt9uoVXxaJW8V7L DdTqRflZr8DN8VR7KB8CM7yJJCzY/cS8I/5HEFBHnR0oUQpDUNKCKbcIGSEbj8UTV3dF 4sx/OfW85ENFMj+QmN37tq095ANolhmcHK9/JqZwfiptmOeAQydF9crGPlrqOL+fW5Vf t3OlvO34PkqBc/ZZLdmae+bjMmcKXH20zYvfiJVegqAYMjW6w/wBQ3DMvJq+5GlMsScL foCg== X-Gm-Message-State: ALoCoQkVDtk9tRCuVNrKMBfaHeKtLKqATJBhvuYemeY1TR/OB58K+PBPwgacwPxh4MtODWK66xdA X-Received: by 10.68.102.3 with SMTP id fk3mr27035337pbb.95.1404852603722; Tue, 08 Jul 2014 13:50:03 -0700 (PDT) Received: from iant-glaptop.roam.corp.google.com.google.com ([172.19.247.149]) by mx.google.com with ESMTPSA id kq10sm56661169pbc.90.2014.07.08.13.50.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 08 Jul 2014 13:50:02 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Fix C-style comment parsing Date: Tue, 08 Jul 2014 13:50:01 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes PR 61746 and gofrontend issue 35 point out a bug in C-style comment parsing in the Go frontend. The sequence /*/ was interpreted as a complete C-style comment. This patch fixes the bug. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and 4.9 branch. Ian diff -r 5d0434c2007e go/lex.cc --- a/go/lex.cc Wed Jul 02 07:22:05 2014 -0700 +++ b/go/lex.cc Tue Jul 08 13:41:25 2014 -0700 @@ -598,7 +598,7 @@ } else if (p[1] == '*') { - this->lineoff_ = p - this->linebuf_; + this->lineoff_ = p + 2 - this->linebuf_; Location location = this->location(); if (!this->skip_c_comment()) return Token::make_invalid_token(location);