Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107098524
D40415.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
511 B
Referenced Files
None
Subscribers
None
D40415.diff
View Options
diff --git a/bin/sh/main.c b/bin/sh/main.c
--- a/bin/sh/main.c
+++ b/bin/sh/main.c
@@ -100,7 +100,13 @@
int
main(int argc, char *argv[])
{
- struct stackmark smark = {0}, smark2;
+ /*
+ * As smark is accessed after a longjmp, it cannot be a local in main().
+ * The C standard specifies that the values of non-volatile local
+ * variables are unspecified after a jump if modified between the
+ * setjmp and longjmp.
+ */
+ static struct stackmark smark, smark2;
volatile int state;
char *shinit;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 11, 2:24 AM (18 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15749092
Default Alt Text
D40415.diff (511 B)
Attached To
Mode
D40415: sh(1): make smark a static variable instead of a local in main()
Attached
Detach File
Event Timeline
Log In to Comment