[nolimips: 202] Fix nolimips' system library's read implementation

ChangeLog | 7 +++++++ src/vm/nolimips_system_library.cc | 3 +++ 2 files changed, 10 insertions(+) Index: trunk/ChangeLog from Benot Perrot <benoit@nostromo.lrde.epita.fr> Fix nolimips' system library's read implementation. * src/vm/nolimips_system_library.cc: (NolimipsSystemLibrary::read): Effectively return -1 on EOF. Index: trunk/src/vm/nolimips_system_library.cc --- src/vm/nolimips_system_library.cc (revision 201) +++ src/vm/nolimips_system_library.cc (working copy) @@ -39,14 +39,17 @@ int i = -1; if (istr) { - for (i = 0; i < count; ++i, ++offset) - { - int c = istr->get(); - if (istr->eof()) - break; + istr->peek(); - mmu.data_store_byte(offset, c); - } + if (!istr->eof()) + for (i = 0; i < count; ++i, ++offset) + { + int c = istr->get(); + if (istr->eof()) + break; + + mmu.data_store_byte(offset, c); + } } return i;
participants (1)
-
Noe