Skip to content

Commit ae39a1d

Browse files
committed
cc: correct handling of allocn(0, 1, d)
Fixes #29. R=r https://golang.org/cl/152076
1 parent d38630f commit ae39a1d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/cmd/cc/lex.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -1566,9 +1566,8 @@ alloc(int32 n)
15661566
void*
15671567
allocn(void *p, int32 n, int32 d)
15681568
{
1569-
15701569
if(p == nil)
1571-
return alloc(d);
1570+
return alloc(n+d);
15721571
p = realloc(p, n+d);
15731572
if(p == nil) {
15741573
print("allocn out of mem\n");

0 commit comments

Comments
 (0)