From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 922793853D74 for ; Mon, 21 Nov 2022 17:50:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 922793853D74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62e.google.com with SMTP id y10so10072185plp.3 for ; Mon, 21 Nov 2022 09:50:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=dfb7h6RoD9+8kU2sz8zb4XemBJITD2whH+KoJPW2YLs=; b=Ez+Ekd+2XUDalvjaFutx8Ts3Mjv8/oaPcP4dVgq7XuRDTYavLTg0bnbJMYny6IafWR gUCR1fmUwBQXU0Q1uIEwH5GayJiEc+QpzbKKmiIapUNQVDYhQPQnp4gO4pM8aRTDVj/D fUPJFTo2Qh2/Nahx6lUK9BbdgimCcNnT2a8PtY76kCDThAfyhIGqfbv5o2y0KkWpgFSy sXaMXQWaUK6Xx4O6wW8Lj6+GBeWWcEupXvj9exMgaju/PAn/YJZO/50wqi8b34mrDDDy UOJLeP7OIShttT2R9iw66+6wSXG5AVJuJMnZk+rqssG9vmfJLmSY5ATaSVX1YmMoG1Jt JIbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dfb7h6RoD9+8kU2sz8zb4XemBJITD2whH+KoJPW2YLs=; b=AseTJ/zwmaSbMah4AnE2PnEol9uPTAFyOdrsbkY+Gg/Q01LtXA3dxIUMgSYu/XEnxU u82PTiIBteF7t534CgwYZn2ql/OcKHqKltYUyZ/c1s73ENnfI29hDMAe9Abvr9SDYhJL D1WSdZN/M9SoVKwQzREAEaIfAavPPe7aGSLQ3Pne9arIt7JJdASmSoeOgmAvKNW1O+s/ ahS/JDVy9VsdX6nqcPC6cPjCVxmA2cT4gofckLdRUUAmqq8P3RoqcYpZtf1FQEIc/vDF M5NV0OnYqZk39vlDjFVDrzgsGnESrneHJHQMYAycwPhwvEOyYSyuMJpEaA3YWKfswD6z zXWw== X-Gm-Message-State: ANoB5pkAjDhHS2ggUfkbY+CdAPkoNvHZQ/cxg34SDsdZSX0hC58gNSD3 enw2Fo6b+VxpQ2kA2M5x+7I= X-Google-Smtp-Source: AA0mqf7h7FZd78Rap4jhGOjs33Cl6xDBYhFGevvEDcYk4bQQRkBrHRU2xQlcMila3dQcAGQJQBG31g== X-Received: by 2002:a17:90b:683:b0:213:cfb4:719 with SMTP id m3-20020a17090b068300b00213cfb40719mr21536155pjz.188.1669053023387; Mon, 21 Nov 2022 09:50:23 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id 63-20020a620542000000b0056bfebfa6e4sm8957194pff.190.2022.11.21.09.50.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Nov 2022 09:50:22 -0800 (PST) Message-ID: Date: Mon, 21 Nov 2022 10:50:21 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 3/6] libcpp: Fix paste error with unknown pragma after macro expansion Content-Language: en-US To: Lewis Hyatt , gcc-patches@gcc.gnu.org References: <2222c8ff04699ae5671e1b654aafe5502259feaa.1667514153.git.lhyatt@gmail.com> From: Jeff Law In-Reply-To: <2222c8ff04699ae5671e1b654aafe5502259feaa.1667514153.git.lhyatt@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/4/22 07:44, Lewis Hyatt via Gcc-patches wrote: > In directives.cc, do_pragma() contains logic to handle a case such as the new > testcase pragma-omp-unknown.c, where an unknown pragma was the result of macro > expansion (for pragma namespaces that permit expansion). This no longer works > correctly as shown by the testcase, fixed by adding PREV_WHITE to the flags on > the second token to prevent an unwanted paste. Also fixed the memory leak, > since the temporary tokens are pushed on their own context, nothing prevents > freeing of the buffer that holds them when the context is eventually popped. > > libcpp/ChangeLog: > > * directives.cc (do_pragma): Fix memory leak in token buffer. Fix > unwanted paste between two tokens. > > gcc/testsuite/ChangeLog: > > * c-c++-common/gomp/pragma-omp-unknown.c: New test. OK jeff