mirror of
https://github.com/golang/go
synced 2024-09-25 05:20:13 -06:00
Fix bug where nothing could ever be added to a code buffer.
R=rsc APPROVED=rsc DELTA=2 (0 added, 0 deleted, 2 changed) OCL=32245 CL=32247
This commit is contained in:
parent
811e59f2fa
commit
33c1045056
@ -49,7 +49,7 @@ func newCodeBuf() *codeBuf {
|
||||
return &codeBuf{make(code, 0, 16)};
|
||||
}
|
||||
|
||||
func (b codeBuf) push(instr func(*vm)) {
|
||||
func (b *codeBuf) push(instr func(*vm)) {
|
||||
n := len(b.instrs);
|
||||
if n >= cap(b.instrs) {
|
||||
a := make(code, n, n*2);
|
||||
@ -62,7 +62,7 @@ func (b codeBuf) push(instr func(*vm)) {
|
||||
b.instrs[n] = instr;
|
||||
}
|
||||
|
||||
func (b codeBuf) get() code {
|
||||
func (b *codeBuf) get() code {
|
||||
// Freeze this buffer into an array of exactly the right size
|
||||
a := make(code, len(b.instrs));
|
||||
for i := range b.instrs {
|
||||
|
Loading…
Reference in New Issue
Block a user