The following code crashes the VM: ```smalltalk i:=0. [ FileDirectory new primLookupEntryIn: 'C:' index: i] whileNotNil: [ i:= i+1]. FileDirectory new primLookupEntryIn: 'C:' index: i+1 ``` The reason is that the `dirCacheHit` path in `sqWin32Directory.c` is taken and `FindNextFileW` is called with `findHandle == NULL`.
Additionally, `primLookupEntryIn` accepts negative indices, which means this works but probably should not: ```smalltalk FileDirectory new primLookupEntryIn: 'C:' index: -1. FileDirectory new primLookupEntryIn: 'C:' index: 0. (FileDirectory new primLookupEntryIn: 'C:' index: 1) ~~(FileDirectory new primLookupEntryIn: 'C:' index: 1) "= true" ```
vm-dev@lists.squeakfoundation.org