diff options
author | Russ Cox <rsc@golang.org> | 2009-11-11 14:52:21 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-11-11 14:52:21 -0800 |
commit | 9811534633d11d9466413fdd69633285a8383917 (patch) | |
tree | aaa8845bc144ac92125f013d8732cfb6eb5ba254 /src/cmd/cc | |
parent | c1c5ec885cf2ec7e0da3c3cbb478e74d7eb20ba9 (diff) | |
download | golang-9811534633d11d9466413fdd69633285a8383917.tar.gz |
cc: correct handling of allocn(0, 1, d)
Fixes issue 29.
R=r
http://codereview.appspot.com/152076
Diffstat (limited to 'src/cmd/cc')
-rw-r--r-- | src/cmd/cc/lex.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cmd/cc/lex.c b/src/cmd/cc/lex.c index b3216af44..ff80bfb32 100644 --- a/src/cmd/cc/lex.c +++ b/src/cmd/cc/lex.c @@ -1566,9 +1566,8 @@ alloc(int32 n) void* allocn(void *p, int32 n, int32 d) { - if(p == nil) - return alloc(d); + return alloc(n+d); p = realloc(p, n+d); if(p == nil) { print("allocn out of mem\n"); |