From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 16 22:10:19 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08147106566B; Sun, 16 Jan 2011 22:10:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EABC08FC15; Sun, 16 Jan 2011 22:10:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0GMAIUl078773; Sun, 16 Jan 2011 22:10:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0GMAIs5078771; Sun, 16 Jan 2011 22:10:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101162210.p0GMAIs5078771@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 16 Jan 2011 22:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217485 - stable/8/bin/sh X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2011 22:10:19 -0000 Author: jilles Date: Sun Jan 16 22:10:18 2011 New Revision: 217485 URL: http://svn.freebsd.org/changeset/base/217485 Log: MFC r216806: sh: Properly restore exception handler in fc. If SIGINT arrived at exactly the right moment (unlikely), an exception handler in a no longer active stack frame would be called. Because the old handler was not used in the normal path, clang thought it was a dead value and if an exception happened it would longjmp() to garbage. This caused builtins/fc1.0 to fail if histedit.c was compiled with clang. (Note: not tested on stable/8 with clang.) Modified: stable/8/bin/sh/histedit.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/histedit.c ============================================================================== --- stable/8/bin/sh/histedit.c Sun Jan 16 21:59:50 2011 (r217484) +++ stable/8/bin/sh/histedit.c Sun Jan 16 22:10:18 2011 (r217485) @@ -214,6 +214,7 @@ histcmd(int argc, char **argv) } argc -= optind, argv += optind; + savehandler = handler; /* * If executing... */ @@ -224,7 +225,6 @@ histcmd(int argc, char **argv) * Catch interrupts to reset active counter and * cleanup temp files. */ - savehandler = handler; if (setjmp(jmploc.loc)) { active = 0; if (editfile) @@ -380,6 +380,7 @@ histcmd(int argc, char **argv) --active; if (displayhist) displayhist = 0; + handler = savehandler; return 0; }