mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Removed compiler confusing setjmp() call
In pseudo_seed(), we removed a call to setjmp() that was only there to add more information to mix into the seed. For compilers such as gcc that used -Wclobbered, the call to setjmp() gave the impression that the hash_val might be clobbered by a longjmp(). Where there is no longjmp() that would use the previous setjmp(), the gcc compiler has nil ways to notice that. So to avoid confusion we removed the setjmp() call. Thanks to <GitHub user mattdm> for raising this potential concern.
This commit is contained in:
9
CHANGES
9
CHANGES
@@ -14,6 +14,15 @@ The following are the changes from calc version 2.14.2.0 to date:
|
|||||||
pre-modified copy of fd_setup. We realloc the fd_orig array and copy
|
pre-modified copy of fd_setup. We realloc the fd_orig array and copy
|
||||||
the fd_setup into it first, before touching the fd_setup array.
|
the fd_setup into it first, before touching the fd_setup array.
|
||||||
|
|
||||||
|
In pseudo_seed(), we removed a call to setjmp() that was only
|
||||||
|
there to add more information to mix into the seed. For compilers
|
||||||
|
such as gcc that used -Wclobbered, the call to setjmp() gave the
|
||||||
|
impression that the hash_val might be clobbered by a longjmp().
|
||||||
|
Where there is no longjmp() that would use the previous setjmp(),
|
||||||
|
the gcc compiler has nil ways to notice that. So to avoid confusion
|
||||||
|
we removed the setjmp() call. Thanks to <GitHub user mattdm> for
|
||||||
|
raising this potential concern.
|
||||||
|
|
||||||
|
|
||||||
The following are the changes from calc version 2.14.1.2 to date:
|
The following are the changes from calc version 2.14.1.2 to date:
|
||||||
|
|
||||||
|
1
seed.c
1
seed.c
@@ -592,7 +592,6 @@ pseudo_seed(void)
|
|||||||
sdata.size = sizeof(sdata);
|
sdata.size = sizeof(sdata);
|
||||||
sdata.prev_hash64_copy = prev_hash64; /* load previous hash */
|
sdata.prev_hash64_copy = prev_hash64; /* load previous hash */
|
||||||
sdata.call_count_copy = ++call_count; /* update call count */
|
sdata.call_count_copy = ++call_count; /* update call count */
|
||||||
(void) setjmp(sdata.env);
|
|
||||||
#if defined(HAVE_ENVIRON)
|
#if defined(HAVE_ENVIRON)
|
||||||
sdata.environ_copy = environ;
|
sdata.environ_copy = environ;
|
||||||
#endif /* HAVE_ENVIRON */
|
#endif /* HAVE_ENVIRON */
|
||||||
|
Reference in New Issue
Block a user