Browse Source

Plan 9 from Bell Labs 2004-07-01

David du Colombier 20 years ago
parent
commit
1eb60131ad
5 changed files with 10 additions and 8 deletions
  1. 1 0
      dist/replica/_plan9.db
  2. 1 1
      dist/replica/plan9.db
  3. 1 0
      dist/replica/plan9.log
  4. 2 2
      sys/src/libmach/8db.c
  5. 5 5
      sys/src/libmach/sym.c

+ 1 - 0
dist/replica/_plan9.db

@@ -12431,3 +12431,4 @@ usr/glenda/lib/profile - 664 glenda glenda 1021580005 847
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+386/bin/aux/acidleak - 775 sys sys 1088651143 67380

+ 1 - 1
dist/replica/plan9.db

@@ -90,7 +90,7 @@
 386/bin/aux/LOCK - 775 sys sys 1085076988 57919
 386/bin/aux/X509gen - 775 sys sys 1048341826 129186
 386/bin/aux/accupoint - 775 sys sys 1085076988 40013
-386/bin/aux/acidleak - 775 sys sys 1064598060 67816
+386/bin/aux/acidleak - 775 sys sys 1088651143 67380
 386/bin/aux/antiword - 775 sys sys 1070288096 511478
 386/bin/aux/apm - 775 sys sys 1086923025 172135
 386/bin/aux/astarld - 775 sys sys 1085076989 62660

+ 1 - 0
dist/replica/plan9.log

@@ -15767,3 +15767,4 @@
 1088263824 16 c 386/lib/ape/libap.a - 664 sys sys 1088263708 806956
 1088560880 0 c sys/man/3/pnp - 664 sys sys 1088560895 4547
 1088560880 1 c sys/src/9/port/devpnp.c - 664 sys sys 1088560907 13624
+1088652697 0 c 386/bin/aux/acidleak - 775 sys sys 1088651143 67380

+ 2 - 2
sys/src/libmach/8db.c

@@ -1418,8 +1418,8 @@ issymref(Instr *ip, Symbol *s, long w, long val)
 	if (s->class==CDATA) {
 		/* use first bss symbol (or "end") rather than edata */
 		if (s->name[0]=='e' && strcmp(s->name, "edata") == 0){
-			if((globalsym(&tmp, s->index+1) && tmp.value==s->value)
-			|| (globalsym(&tmp, s->index-1) && tmp.value==s->value))
+			if((s ->index >= 0 && globalsym(&tmp, s->index+1) && tmp.value==s->value)
+			|| (s->index > 0 && globalsym(&tmp, s->index-1) && tmp.value==s->value))
 				*s = tmp;
 		}
 		if (w == 0)

+ 5 - 5
sys/src/libmach/sym.c

@@ -321,7 +321,7 @@ symbase(long *n)
 Sym *
 getsym(int index)
 {
-	if(index < nsym)
+	if(index >= 0 && index < nsym)
 		return &symbols[index];
 	return 0;
 }
@@ -590,7 +590,7 @@ textsym(Symbol *s, int index)
 
 	if(buildtbls() == 0)
 		return 0;
-	if(index >= ntxt)
+	if(index < 0 || index >= ntxt)
 		return 0;
 	fillsym(txt[index].sym, s);
 	s->handle = (void *)&txt[index];
@@ -607,7 +607,7 @@ filesym(int index, char *buf, int n)
 
 	if(buildtbls() == 0)
 		return 0;
-	if(index >= nfiles)
+	if(index < 0 || index >= nfiles)
 		return 0;
 	hp = files[index].hist;
 	if(!hp || !hp->name)
@@ -766,7 +766,7 @@ localsym(Symbol *s, int index)
 {
 	Txtsym *tp;
 
-	if(s == 0)
+	if(s == 0 || index < 0)
 		return 0;
 	if(buildtbls() == 0)
 		return 0;
@@ -791,7 +791,7 @@ globalsym(Symbol *s, int index)
 	if(buildtbls() == 0)
 		return 0;
 
-	if(index < nglob) {
+	if(index >=0 && index < nglob) {
 		fillsym(globals[index], s);
 		s->index = index;
 		return 1;