Summary
Maybe/Just Int checker in Silex compilation
Metadata
- Id: df4b4b5ff0a9f739011d8c8f304c503ed66d2eee
- Trac id: 1762
- Type: enhancement
- Reporter: Idiomdrottning
- Owner:
- Cc:
- Status: reopened
- Component: scrutinizer
- Estimated difficulty:
- Resolution:
- Priority: not urgent at all
- Milestone: someday
- Version: 5.2.0
- Changetime: 2021-06-06 18:04:50 UTC
- Created: 2021-06-06 07:09:14 UTC
- Keywords:
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).
Changes and comments
[2021-06-06 13:15:01 UTC] megane changed status from new to closed
[2021-06-06 13:15:01 UTC] megane set resolution to wontfix
[2021-06-06 13:15:01 UTC] megane wrote:
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.
[2021-06-06 13:29:59 UTC] megane changed status from closed to reopened
[2021-06-06 13:29:59 UTC] megane removed resolution wontfix
[2021-06-06 13:29:59 UTC] megane changed component from unknown to scrutinizer
[2021-06-06 13:29:59 UTC] megane wrote:
Maybe make-vector and similar container type constructors could return something more clever.
[2021-06-06 18:04:50 UTC] Idiomdrottning wrote:
I was thinking the scrutinizer should just say "might have" instead of "has". A little more humbly scrutinizing.