allInstancesPrim has 2 bugs:
- if the rememberedSet is full and #allInstancesPrim is invoked and an instance in newSpace is found, the rememberedSet needs to grow, to make room for the allInstances result array. This process overwrites the allInstances result array and the rememberedSet is returned instead of the array containing the requested instances.
- if an instance in newSpace is found, the allInstances result array must be added to the rememberedSet. This process destroys a CPU register, which points to the next object in newSpace. This causes a premature exit of the loop walking through newSpace. So only the first instance in newSpace is being added to the results array.
Use the VMPatcher from Source code for VS-Smalltalk to fix this bug.