Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(339)

Unified Diff: src/pkg/runtime/proc.c

Issue 71440043: code review 71440043: runtime: handle Go calls C calls Go panic correctly on ... (Closed)
Patch Set: diff -r 1a0714819799 https://code.google.com/p/go/ Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/runtime/export_test.go ('k') | src/pkg/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/runtime/proc.c
===================================================================
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -601,14 +601,12 @@
void
runtime·mstart(void)
{
-#ifdef GOOS_windows
-#ifdef GOARCH_386
+#ifdef GOOSARCH_windows_386
// It is used by windows-386 only. Unfortunately, seh needs
// to be located on os stack, and mstart runs on os stack
// for both m0 and m.
SEH seh;
#endif
-#endif
if(g != m->g0)
runtime·throw("bad runtime·mstart");
@@ -619,11 +617,9 @@
runtime·gosave(&m->g0->sched);
m->g0->sched.pc = (uintptr)-1; // make sure it is never used
m->g0->stackguard = m->g0->stackguard0; // cgo sets only stackguard0, copy it to stackguard
-#ifdef GOOS_windows
-#ifdef GOARCH_386
+#ifdef GOOSARCH_windows_386
m->seh = &seh;
#endif
-#endif
runtime·asminit();
runtime·minit();
@@ -775,15 +771,13 @@
g->stackguard = (uintptr)(&x - 32*1024);
g->stackguard0 = g->stackguard;
-#ifdef GOOS_windows
-#ifdef GOARCH_386
+#ifdef GOOSARCH_windows_386
// On windows/386, we need to put an SEH frame (two words)
// somewhere on the current stack. We are called from cgocallback_gofunc
// and we know that it will leave two unused words below m->curg->sched.sp.
// Use those.
m->seh = (SEH*)((uintptr*)&x + 1);
#endif
-#endif
// Initialize this thread to use the m.
runtime·asminit();
@@ -862,11 +856,9 @@
// Undo whatever initialization minit did during needm.
runtime·unminit();
-#ifdef GOOS_windows
-#ifdef GOARCH_386
+#ifdef GOOSARCH_windows_386
m->seh = nil; // reset dangling typed pointer
#endif
-#endif
// Clear m and g, and return m to the extra list.
// After the call to setmg we can only call nosplit functions.
« no previous file with comments | « src/pkg/runtime/export_test.go ('k') | src/pkg/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b