From owner-dev-commits-src-main@freebsd.org Sun Dec 27 23:03:40 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 425904CA7F2; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3x7J19VLz3s3K; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 104427433; Sun, 27 Dec 2020 23:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRN3evf008630; Sun, 27 Dec 2020 23:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRN3dR7008629; Sun, 27 Dec 2020 23:03:39 GMT (envelope-from git) Date: Sun, 27 Dec 2020 23:03:39 GMT Message-Id: <202012272303.0BRN3dR7008629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: f2d48b5e2c3b - main - Merge commit d8a09b3a0 from openzfs git (by Ryan Libby): MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2d48b5e2c3b45850585e4d7aee324fe148afbf2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 23:03:40 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=f2d48b5e2c3b45850585e4d7aee324fe148afbf2 commit f2d48b5e2c3b45850585e4d7aee324fe148afbf2 Author: Ryan Libby AuthorDate: 2020-12-27 22:33:13 +0000 Commit: Ryan Libby CommitDate: 2020-12-27 22:33:13 +0000 Merge commit d8a09b3a0 from openzfs git (by Ryan Libby): lua: avoid gcc -Wreturn-local-addr bug Avoid a bug with gcc's -Wreturn-local-addr warning with some obfuscation. In buggy versions of gcc, if a return value is an expression that involves the address of a local variable, and even if that address is legally converted to a non-pointer type, a warning may be emitted and the value of the address may be replaced with zero. Howerver, buggy versions don't emit the warning or replace the value when simply returning a local variable of non-pointer type. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90737 Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Libby Closes #11337 --- sys/contrib/openzfs/module/lua/ldo.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/contrib/openzfs/module/lua/ldo.c b/sys/contrib/openzfs/module/lua/ldo.c index 0344a29fd8e8..474fe659bcef 100644 --- a/sys/contrib/openzfs/module/lua/ldo.c +++ b/sys/contrib/openzfs/module/lua/ldo.c @@ -33,14 +33,16 @@ #if defined (_KERNEL) && defined(__linux__) #include static intptr_t stack_remaining(void) { - char local; - return (intptr_t)(&local - (char *)current->stack); + intptr_t local; + local = (intptr_t)&local - (intptr_t)current->stack; + return local; } #elif defined (_KERNEL) && defined(__FreeBSD__) #include static intptr_t stack_remaining(void) { - char local; - return (intptr_t)(&local - (char *)curthread->td_kstack); + intptr_t local; + local = (intptr_t)&local - (intptr_t)curthread->td_kstack; + return local; } #else static intptr_t stack_remaining(void) {