You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jsrc/d.c
+3-12Lines changed: 3 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -338,18 +338,6 @@ R 0;
338
338
// this routine also does the work for jtjsigd (domain error with message text), jtjsignal (old-fashioned terse display),
339
339
// jtjsignal3 (terse display for lines known to be from an explicit definition, giving line#/column), and
340
340
// x 13!:8 y (display text x, set error# y)
341
-
// Encoded as follows using upper bits of e:
342
-
#defineEMSGE 0xff // the error-code part
343
-
#defineEMSGNOEVM 0x200 // set to suppress moving the terse message
344
-
#defineEMSGLINEISA 0x400 // line contains A block for message (otherwise it points to string if any and info has the length of the string)
345
-
#defineEMSGCXINFO 0x800 // info contains line#/col# of error
346
-
#defineEMSGSPACEAFTEREVM 0x1000 // set if terse message should be followed by a space
347
-
#defineEMSGLINEISTERSE 0x2000 // set if line has the text for the terse message (13!:8)
348
-
#defineEMSGLINEISNAME 0x4000 // set if line has the name to use in place of jt->curname
349
-
// no bits set means terse display (jsignal)
350
-
// bit 9 set: line=failing line, info=failing line#/column for jsignal3
351
-
// bit 10 set: line=A text for message (sigstr)
352
-
// bit 11 set: line->text as C string (sigd)
353
341
//
354
342
// we look at emsgstate and do as little as possible if the user isn't going to see the message
355
343
//
@@ -375,6 +363,7 @@ A jtjsignale(J jt,I eflg,A line,I info){
375
363
jteputlnolf(jt,msg); // header of first line: terse string
376
364
Anameblok=jt->curname; nameblok=eflg&EMSGLINEISNAME?line:nameblok; // if user overrides the name, use the user's name
377
365
if(nameblok){if(!jt->glock){eputs(": "); ep(AN(nameblok),NAV(nameblok)->s);}} // ...followed by name of running entity
366
+
if(eflg&EMSGFROMPYX)eputs(" (from pyx)"); // if the message came from a pyx, mark it as such
378
367
eputc(eflg&EMSGSPACEAFTEREVM?' ':CLF); // ... that's the first line, unless user wants added text on the same line
379
368
if(!jt->glock){ // suppress detail if locked
380
369
if((line!=0) && !(eflg&EMSGLINEISTERSE) && !(jt->emsgstate&EMSGSTATENOLINE)){ // if there is a user line, and its display not suppressed
@@ -397,6 +386,8 @@ A jtjsignale(J jt,I eflg,A line,I info){
397
386
jt->etxn1=jt->etxn; // save length of finished message
398
387
}
399
388
}
389
+
// if this error was forwarded from a pyx, we can't eformat it - we have no self/arguments. Set that we have tried formatting already to suppress further formatting
#defineNTSTACK (1LL<<(AUDITEXECRESULTS?24:14)) // number of BYTES in an allocated block of tstack - pointers to allocated blocks - allocation is bigger to leave this many bytes on boundary
710
710
#defineNTSTACKBLOCK 2048 // boundary for beginning of stack block
711
711
712
+
// flags for jteformat
713
+
#defineEMSGE 0xff // the error-code part
714
+
#defineEMSGNOEVM 0x200 // set to suppress moving the terse message
715
+
#defineEMSGLINEISA 0x400 // line contains A block for message (otherwise it points to string if any and info has the length of the string)
716
+
#defineEMSGCXINFO 0x800 // info contains line#/col# of error
717
+
#defineEMSGSPACEAFTEREVM 0x1000 // set if terse message should be followed by a space
718
+
#defineEMSGLINEISTERSE 0x2000 // set if line has the text for the terse message (13!:8)
719
+
#defineEMSGLINEISNAME 0x4000 // set if line has the name to use in place of jt->curname
720
+
#defineEMSGFROMPYX 0x8000 // set if this error is being copied from a pyx (it can't be analyzed, and it should be marked specially
721
+
// no bits set means terse display (jsignal)
722
+
// bit 9 set: line=failing line, info=failing line#/column for jsignal3
#defineASSERTN(b,e,nm) {if(unlikely(!(b))){jtjsignale(jt,e|0x4000,(nm),0); R 0;}} // signal error, overriding the running name with a different one
823
-
#defineASSERTNGOTO(b,e,nm,lbl) {if(unlikely(!(b))){jtjsignale(jt,e|0x4000,(nm),0); goto lbl;}} // same, but without the exit
836
+
#defineASSERTN(b,e,nm) {if(unlikely(!(b))){jtjsignale(jt,e|EMSGLINEISNAME,(nm),0); R 0;}} // signal error, overriding the running name with a different one
837
+
#defineASSERTNGOTO(b,e,nm,lbl) {if(unlikely(!(b))){jtjsignale(jt,e|EMSGLINEISNAME,(nm),0); goto lbl;}} // same, but without the exit
838
+
#defineASSERTPYX(e) {jsignal((e)|EMSGFROMPYX); R 0;}
824
839
#defineASSERTSYS(b,s) {if(unlikely(!(b))){fprintf(stderr,"system error: %s : file %s line %d\n",s,__FILE__,__LINE__); jsignal(EVSYSTEM); jtwri(JJTOJ(jt),MTYOSYS,"",(I)strlen(s),s); R 0;}}
ASSERT(ISDENSETYPE(t,NUMERIC),EVDOMAIN); // coeffs must be dense numeric
229
-
RZ(r=jico2(ne(w,num(0)),num(1))); m=AV(r)[0]; m=(m==n)?0:m; // r=block for index of last nonzero; m=degree of polynomial (but 0 if all zeros)
229
+
RZ(r=jico2(ne(w,num(0)),num(1))); RZ(r=mkwris(r)) m=AV(r)[0]; m=(m==n)?0:m; // r=block for index of last nonzero; m=degree of polynomial (but 0 if all zeros)
230
230
ASSERT(m||equ(num(0),head(w)),EVDOMAIN); // error if unsolvable constant polynomial
0 commit comments