From patchwork Wed Dec 22 18:19:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Azat Khuzhin X-Patchwork-Id: 49200 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3EF0E3858402 for ; Wed, 22 Dec 2021 18:19:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3EF0E3858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1640197193; bh=9PjbdW4Q9JFT58yEV4o5ZOkuC6zCvlwx3oJI2u+r9So=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=enUj1FGZXyLJ5LdbxdwnpvA29m+ktACZVpKWtEfZK2XmsqNnP0yFKKJ1jtAFKZJR5 SH6LwemHiKIUpvPNcJlwJeDXgEh0/p5d0mApAEbh6WBqA6Swx9Jkapg3VMv4GDiFel 8gexjd5fEBcUgNV0Gz/jJWoUcv3uw/1qho90V89s= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id B24073858D35 for ; Wed, 22 Dec 2021 18:19:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B24073858D35 Received: by mail-lj1-x236.google.com with SMTP id by39so5162493ljb.2 for ; Wed, 22 Dec 2021 10:19:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9PjbdW4Q9JFT58yEV4o5ZOkuC6zCvlwx3oJI2u+r9So=; b=Yfyov+XGirV8FFgCmi+1NDIAKC2OfyFSqyGaFgsmI8rHGD0kjDsR0X1rcdDuGoS1u4 8TyKGkvPyGn9ZaRY2pp+cAnYgPP/+0IVaoWM2lwXjg8C0o0TDU+Fo6tWJ0tvqyQoBe+4 +sB1g7EYnw8+4n4E157efNhXsYzCvB3g4dtyGxNT4DR/5ZZRvex9UyF+trjKfEyawNPg E2ioy/EFTzS9MMFI3q/MrtGJdFcu97FvVDlteVoMgxSrvYHVgGAV5N+M0SHrpeqTx/8K c7TE2uA2QKra+uytR4R14psPES0tqOhXj2W2fOddFXmPPRk5Q/iWKpZsJ+gPvKUHExHc 6RaQ== X-Gm-Message-State: AOAM532U7AjEyNse0yIt9UiB2cCg8LWyFXQGq2YsvEIFQzf0D4YAjua6 3544R0c6k7ZYp4dpLV2DCYGrtBji2G0= X-Google-Smtp-Source: ABdhPJzKhLVlgoiR+sWI+l+sGQX2QBlIzPYNxap+XXzpZET8swV3pcnJcCcH7LYTRZ8QW4vsDMgOQQ== X-Received: by 2002:a2e:a792:: with SMTP id c18mr2899356ljf.443.1640197162162; Wed, 22 Dec 2021 10:19:22 -0800 (PST) Received: from localhost ([146.66.199.134]) by smtp.gmail.com with ESMTPSA id z6sm83740lfq.219.2021.12.22.10.19.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Dec 2021 10:19:21 -0800 (PST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] libsanitizer: Fix setbuffer() interceptor (accept size not mode) Date: Wed, 22 Dec 2021 21:19:12 +0300 Message-Id: <20211222181912.29879-1-a3at.mail@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, UNWANTED_LANGUAGE_BODY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Azat Khuzhin via Gcc-patches From: Azat Khuzhin Reply-To: Azat Khuzhin Cc: Azat Khuzhin Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Fixes: b667dd7017a ("Libsanitizer merge from trunk r368656.") Refs: https://reviews.llvm.org/D116176 --- .../sanitizer_common/sanitizer_common_interceptors.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc b/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc index abb38ccfa15..60b0545a943 100644 --- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc +++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc @@ -7858,12 +7858,13 @@ INTERCEPTOR(void, setbuf, __sanitizer_FILE *stream, char *buf) { unpoison_file(stream); } -INTERCEPTOR(void, setbuffer, __sanitizer_FILE *stream, char *buf, int mode) { +INTERCEPTOR(void, setbuffer, __sanitizer_FILE *stream, char *buf, + SIZE_T size) { void *ctx; - COMMON_INTERCEPTOR_ENTER(ctx, setbuffer, stream, buf, mode); + COMMON_INTERCEPTOR_ENTER(ctx, setbuffer, stream, buf, size); REAL(setbuffer)(stream, buf, mode); if (buf) { - COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, __sanitizer_bufsiz); + COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, size); } if (stream) unpoison_file(stream);