Opened 10 years ago

Closed 10 years ago

#1063 closed defect (fixed)

scrutiny-tests-2.scm contains a bad test but it passes anyway!

Reported by: sjamaan Owned by:
Priority: critical Milestone: 4.9.0
Component: scrutinizer Version: 4.8.x
Keywords: Cc:
Estimated difficulty:

Description

(predicate list? (l n p) (i f))

This should fail because p is not a proper list. It looks like the scrutinizer optimizes away the actual check(?)

Possibly a duplicate of #1039

Change History (2)

comment:1 Changed 10 years ago by evhan

The reason the assertion fails but the test succeeds anyway is that scrutiny-tests-2.scm is compiled with -analyze-only and never run, just to generate the scrutiny output. If it were run there'd be an unrelated error (let vs. let*, I'll submit something for that shortly).

Regarding the scrutiny, the (list? p) check doesn't generate a warning since the expansion of assert includes a call to ##sys#error, which (because it isn't pure/clean/etc.) causes the pair p -- which starts the program with type (pair fixnum fixnum) -- to be smashed into simply pair. After that, nothing can be said in the argument type comparison of (not list) and pair.

I wonder if the complex type smashing can be safely avoided for noreturn procedures?

comment:2 Changed 10 years ago by sjamaan

Resolution: fixed
Status: newclosed

Fixed with 62157e9

Note: See TracTickets for help on using tickets.