Opened 5 months ago

Last modified 5 months ago

#1762 reopened enhancement

Maybe/Just Int checker in Silex compilation

Reported by: Idiomdrottning Owned by:
Priority: not urgent at all Milestone: someday
Component: scrutinizer Version: 5.2.0
Keywords: Cc:
Estimated difficulty:

Description

When chicken-install silex I get this

Warning: Invalid argument

In file `silex.scm:472',
In module `silex',
In procedure `digraph',
In procedure `store-final338',
In procedure `loop',
In procedure call:

(scheme#vector-set! prio voisin infinity)

Argument #2 to procedure `vector-set!' has an invalid type:

false

The expected type is:

fixnum

This is the expression:

voisin

Procedure vector-set!' from module scheme' has this type:

(vector fixnum * -> undefined)

In the code, the index value "voisin" is derived from a vector-ref call on another vector that's initialized with #f's but populated by fixnums (hopefully? I didn't fully analyze the code here…) before being referenced.

So probably one of two things are going on:

The silex code is bugged and the variable won't be a fixnum in time (in which case this is is a serious bug in silex), or (what I believe is more likely)

The type-checking code is mislabeling the situation here. It doesn't know that it'll be an int in time. This is just an, uh, "cosmetic" bug in core, which is how I'm labeling it. Or I'm wrong and it's instead a serious bug in exts (silex).

Change History (3)

comment:1 Changed 5 months ago by megane

Resolution: wontfix
Status: newclosed

This is the kind of code where, in general, the scrutinizer would have to solve the halting problem to figure out if the value is valid or not. Maybe there's a error in silex, but probably not as you said.

An easy way to silence the warning is to init the vector with (the * #f) instead of plain #f.

comment:2 Changed 5 months ago by megane

Component: unknownscrutinizer
Resolution: wontfix
Status: closedreopened

Maybe make-vector and similar container type constructors could return something more clever.

comment:3 Changed 5 months ago by Idiomdrottning

I was thinking the scrutinizer should just say "might have" instead of "has". A little more humbly scrutinizing.

Note: See TracTickets for help on using tickets.