Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(43)

Side by Side Diff: src/cmd/5g/cgen.c

Issue 9033043: code review 9033043: cmd/gc: fix some overflows in the compiler (Closed)
Patch Set: diff -r 3cbb458c93cf https://code.google.com/p/go/ Created 11 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/cmd/5g/gsubr.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 #include <u.h> 5 #include <u.h>
6 #include <libc.h> 6 #include <libc.h>
7 #include "gg.h" 7 #include "gg.h"
8 8
9 /* 9 /*
10 * generate: 10 * generate:
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 } 673 }
674 break; 674 break;
675 675
676 case OIND: 676 case OIND:
677 cgen(nl, res); 677 cgen(nl, res);
678 break; 678 break;
679 679
680 case ODOT: 680 case ODOT:
681 agen(nl, res); 681 agen(nl, res);
682 // explicit check for nil if struct is large enough 682 // explicit check for nil if struct is large enough
683 » » // that we might derive too big a pointer. 683 » » // that we might derive too big a pointer. If the left node
684 » » // was ODOT we have already done the nil check.
685 » » if(nl->op != ODOT)
684 if(nl->type->width >= unmappedzero) { 686 if(nl->type->width >= unmappedzero) {
685 regalloc(&n1, types[tptr], N); 687 regalloc(&n1, types[tptr], N);
686 gmove(res, &n1); 688 gmove(res, &n1);
687 regalloc(&n2, types[TUINT8], &n1); 689 regalloc(&n2, types[TUINT8], &n1);
688 n1.op = OINDREG; 690 n1.op = OINDREG;
689 n1.type = types[TUINT8]; 691 n1.type = types[TUINT8];
690 n1.xoffset = 0; 692 n1.xoffset = 0;
691 gmove(&n1, &n2); 693 gmove(&n1, &n2);
692 regfree(&n1); 694 regfree(&n1);
693 regfree(&n2); 695 regfree(&n2);
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 regfree(&nodl); 1722 regfree(&nodl);
1721 return 0; 1723 return 0;
1722 1724
1723 yes: 1725 yes:
1724 if(freer) 1726 if(freer)
1725 regfree(&nodr); 1727 regfree(&nodr);
1726 if(freel) 1728 if(freel)
1727 regfree(&nodl); 1729 regfree(&nodl);
1728 return 1; 1730 return 1;
1729 } 1731 }
OLDNEW
« no previous file with comments | « no previous file | src/cmd/5g/gsubr.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b