HomeFreeBSD

mail: add volatile in grabh()

Description

mail: add volatile in grabh()

setjmp() requires that any stack variables modified between the setjmp
call and the longjmp() must be volatile. This means that 'saveint' in
grabh() must be volatile, since it's modified after the setjmp().
Otherwise, the signal handler is not properly restored, resulting in a
crash (SIGBUS) if ^C is typed twice while composing.

PR: 276119
Reported by: Christopher Davidson <christopher.davidson@gmail.com>
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/993

(cherry picked from commit 6c951b37170f1fb2ae8b4827070743e61b6eaed2)

Details

Provenance
lexi_le-fay.orgAuthored on Jan 4 2024, 10:34 PM
markjCommitted on Jan 19 2024, 2:26 PM
Parents
rG62d25c65977f: usr.bin/gh-bc: fix missing LTO support after MFC
Branches
Unknown
Tags
Unknown