git: 9front

Download patch

ref: 106cbc54a185bca1efa644f3aed97a4b3e5e35eb
parent: ae5a2264202ef457f2bec50dfbd1a407f52f02c1
parent: 52236c7b9e5341744a6f4df3d47db9a07145bbaa
author: aiju <devnull@localhost>
date: Fri Jan 10 13:49:39 EST 2020

merge

--- a/sys/src/cmd/dtracy/act.c
+++ b/sys/src/cmd/dtracy/act.c
@@ -192,7 +192,8 @@
 			goto again;
 		case 'x': case 'X': case 'o': case 'b': case 'd':
 			if(n >= narg) sysfatal("printf() too few arguments");
-			if(arg[n]->typ->type != TYPINT) sysfatal("print() %%%c with non-integer", *fmt);
+			if(arg[n]->typ->type != TYPINT)
+				sysfatal("%d: print() %%%c with non-integer", arg[n]->line, *fmt);
 			arg[n] = tracegen(arg[n], g, recoff);
 			n++;
 			fmtrune(&f, 'l');
@@ -201,7 +202,8 @@
 			break;
 		case 's':
 			if(n >= narg) sysfatal("printf() too few arguments");
-			if(arg[n]->typ->type != TYPSTRING) sysfatal("print() %%s with non-string");
+			if(arg[n]->typ->type != TYPSTRING)
+				sysfatal("%d: print() %%s with non-string", arg[n]->line);
 			arg[n] = tracegen(arg[n], g, recoff);
 			n++;
 			fmtrune(&f, *fmt);
--- a/sys/src/cmd/dtracy/dat.h
+++ b/sys/src/cmd/dtracy/dat.h
@@ -75,6 +75,7 @@
 	Symbol *sym;
 	char *str;
 	s64int num;
+	int line;
 	
 	/* used by elidecasts() */
 	char databits;
--- a/sys/src/cmd/dtracy/lex.c
+++ b/sys/src/cmd/dtracy/lex.c
@@ -239,6 +239,7 @@
 	
 	n = emalloc(sizeof(Node));
 	n->type = type;
+	n->line = lineno;
 	va_start(va, type);
 	switch(type){
 	case OBIN:
--