Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
e90314d0
Commit
e90314d0
authored
Jan 27, 2009
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pragma textflag
fixes latent bugs in go and defer R=r OCL=23613 CL=23613
parent
53e69e1d
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
19 deletions
+27
-19
lex.c
src/cmd/6a/lex.c
+7
-0
txt.c
src/cmd/6c/txt.c
+3
-1
txt.c
src/cmd/8c/txt.c
+3
-1
cc.h
src/cmd/cc/cc.h
+2
-2
dpchk.c
src/cmd/cc/dpchk.c
+6
-12
lex.c
src/cmd/cc/lex.c
+0
-1
macbody
src/cmd/cc/macbody
+2
-2
proc.c
src/runtime/proc.c
+4
-0
No files found.
src/cmd/6a/lex.c
View file @
e90314d0
...
...
@@ -1334,5 +1334,12 @@ praghjdicks(void)
;
}
void
pragtextflag
(
void
)
{
while
(
getnsc
()
!=
'\n'
)
;
}
#include "../cc/lexbody"
#include "../cc/macbody"
src/cmd/6c/txt.c
View file @
e90314d0
...
...
@@ -1473,7 +1473,9 @@ gpseudo(int a, Sym *s, Node *n)
p
->
as
=
a
;
p
->
from
.
type
=
D_EXTERN
;
p
->
from
.
sym
=
s
;
p
->
from
.
scale
=
(
profileflg
?
0
:
NOPROF
);
p
->
from
.
scale
=
textflag
;
textflag
=
0
;
if
(
s
->
class
==
CSTATIC
)
p
->
from
.
type
=
D_STATIC
;
naddr
(
n
,
&
p
->
to
);
...
...
src/cmd/8c/txt.c
View file @
e90314d0
...
...
@@ -1363,7 +1363,9 @@ gpseudo(int a, Sym *s, Node *n)
p
->
as
=
a
;
p
->
from
.
type
=
D_EXTERN
;
p
->
from
.
sym
=
s
;
p
->
from
.
scale
=
(
profileflg
?
0
:
NOPROF
);
p
->
from
.
scale
=
textflag
;
textflag
=
0
;
if
(
s
->
class
==
CSTATIC
)
p
->
from
.
type
=
D_STATIC
;
naddr
(
n
,
&
p
->
to
);
...
...
src/cmd/cc/cc.h
View file @
e90314d0
...
...
@@ -498,7 +498,7 @@ EXTERN Term term[NTERM];
EXTERN
int
nterm
;
EXTERN
int
packflg
;
EXTERN
int
fproundflg
;
EXTERN
int
profilefl
g
;
EXTERN
int
textfla
g
;
EXTERN
int
ncontin
;
EXTERN
int
canreach
;
EXTERN
int
warnreach
;
...
...
@@ -747,7 +747,7 @@ void arginit(void);
void
pragvararg
(
void
);
void
pragpack
(
void
);
void
pragfpround
(
void
);
void
pragprofile
(
void
);
void
pragtextflag
(
void
);
void
pragincomplete
(
void
);
/*
...
...
src/cmd/cc/dpchk.c
View file @
e90314d0
...
...
@@ -450,25 +450,19 @@ pragfpround(void)
}
void
prag
profile
(
void
)
prag
textflag
(
void
)
{
Sym
*
s
;
profilefl
g
=
0
;
textfla
g
=
0
;
s
=
getsym
();
if
(
s
)
{
profileflg
=
atoi
(
s
->
name
+
1
);
if
(
strcmp
(
s
->
name
,
"on"
)
==
0
||
strcmp
(
s
->
name
,
"yes"
)
==
0
)
profileflg
=
1
;
}
textflag
=
7
;
if
(
s
)
textflag
=
atoi
(
s
->
name
+
1
);
while
(
getnsc
()
!=
'\n'
)
;
if
(
debug
[
'f'
])
if
(
profileflg
)
print
(
"%4ld: profileflg %d
\n
"
,
lineno
,
profileflg
);
else
print
(
"%4ld: profileflg off
\n
"
,
lineno
);
print
(
"%4ld: textflag %d
\n
"
,
lineno
,
textflag
);
}
void
...
...
src/cmd/cc/lex.c
View file @
e90314d0
...
...
@@ -75,7 +75,6 @@ main(int argc, char *argv[])
ginit
();
arginit
();
profileflg
=
1
;
/* #pragma can turn it off */
tufield
=
simplet
((
1L
<<
tfield
->
etype
)
|
BUNSIGNED
);
ndef
=
0
;
outfile
=
0
;
...
...
src/cmd/cc/macbody
View file @
e90314d0
...
...
@@ -725,8 +725,8 @@ macprag(void)
pragfpround();
return;
}
if(s && strcmp(s->name, "
profile
") == 0) {
prag
profile
();
if(s && strcmp(s->name, "
textflag
") == 0) {
prag
textflag
();
return;
}
if(s && strcmp(s->name, "varargck") == 0) {
...
...
src/runtime/proc.c
View file @
e90314d0
...
...
@@ -155,6 +155,7 @@ malg(int32 stacksize)
return
g
;
}
#pragma textflag 7
void
sys
·
newproc
(
int32
siz
,
byte
*
fn
,
byte
*
arg0
)
{
...
...
@@ -204,6 +205,7 @@ sys·newproc(int32 siz, byte* fn, byte* arg0)
//printf(" goid=%d\n", newg->goid);
}
#pragma textflag 7
void
sys
·
deferproc
(
int32
siz
,
byte
*
fn
,
byte
*
arg0
)
{
...
...
@@ -219,6 +221,7 @@ sys·deferproc(int32 siz, byte* fn, byte* arg0)
g
->
defer
=
d
;
}
#pragma textflag 7
void
sys
·
deferreturn
(
int32
arg0
)
{
...
...
@@ -760,6 +763,7 @@ newstack(void)
*
(
int32
*
)
345
=
123
;
// never return
}
#pragma textflag 7
void
sys
·
morestack
(
uint64
u
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment