Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/goPublic

Commit64de40a

Browse files
committed
[release-branch.go1.3] runtime: revise CL 105140044 (defer nil) to work on Windows
««« CL 105120044 / 824ea5943ba8runtime: revise CL 105140044 (defer nil) to work on WindowsIt appears that something about Go on Windowscannot handle the fault cause by a jump to address 0.The way Go represents and calls functions, thisnever happened at all, until CL 105140044.This CL changes the code added in CL 105140044to make jump to 0 impossible once again.Fixes#8047. (again, on Windows)TBR=bradfitzR=golang-codereviews, daveCC=adg, golang-codereviews, iant, rhttps://golang.org/cl/105120044»»»LGTM=bradfitzR=golang-codereviews, bradfitz, alex.brainmanCC=adg, golang-codereviewshttps://golang.org/cl/108890045
1 parent69616e4 commit64de40a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎src/pkg/runtime/stack.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include"funcdata.h"
1010
#include"typekind.h"
1111
#include"type.h"
12+
#include"../../cmd/ld/textflag.h"
1213

1314
enum
1415
{
@@ -851,16 +852,24 @@ runtime·newstack(void)
851852
*(int32*)345=123;// never return
852853
}
853854

855+
#pragma textflag NOSPLIT
856+
void
857+
runtime·nilfunc(void)
858+
{
859+
*(byte*)0=0;
860+
}
861+
854862
// adjust Gobuf as if it executed a call to fn
855863
// and then did an immediate gosave.
856864
void
857865
runtime·gostartcallfn(Gobuf*gobuf,FuncVal*fv)
858866
{
859867
void*fn;
860868

861-
fn=nil;
862869
if(fv!=nil)
863870
fn=fv->fn;
871+
else
872+
fn=runtime·nilfunc;
864873
runtime·gostartcall(gobuf,fn,fv);
865874
}
866875

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp