paranoiacblack/Obfuscated-OS — comment on commit f4b595e42f80ac5b44870ad2a834e65a6f800126
File: nachos/userprog/UserProcess.java line 367
By paranoiacblack:

Haha, this will always segfault actually. Or, excuse me, throw a NullPointerException. Mostly because fileMap currently has no elements with key 0, 1, or 2, since those are reserved stream names that haven't been handled yet. The correct way to do this is to iterate through the fileMap using the enumeration properties. A for(0 to size) loop won't work because there's no guarantee a certain index exists at this point.