Date: Wed, 29 Dec 2010 19:39:52 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r216806 - head/bin/sh Message-ID: <201012291939.oBTJdqDG010792@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Wed Dec 29 19:39:51 2010 New Revision: 216806 URL: http://svn.freebsd.org/changeset/base/216806 Log: 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. MFC after: 1 week Modified: head/bin/sh/histedit.c Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Wed Dec 29 18:17:36 2010 (r216805) +++ head/bin/sh/histedit.c Wed Dec 29 19:39:51 2010 (r216806) @@ -232,6 +232,7 @@ histcmd(int argc, char **argv) } argc -= optind, argv += optind; + savehandler = handler; /* * If executing... */ @@ -242,7 +243,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) @@ -399,6 +399,7 @@ histcmd(int argc, char **argv) --active; if (displayhist) displayhist = 0; + handler = savehandler; return 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012291939.oBTJdqDG010792>