[PATCH] Add test showing error in StreamingMemoryObject.setKnownObjectSize().

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Sun Apr 12 04:10:12 PDT 2015


sorry, looks like fab didn't sent the comment before. Trying agin.


================
Comment at: include/llvm/Support/StreamingMemoryObject.h:84
@@ -79,3 +83,3 @@
     }
-    return Pos < BytesRead;
+    return (Pos < BytesRead) || (ObjectSize && Pos < ObjectSize);
   }
----------------
I still don't get it. 

The comment says

Returns true if Pos can be read.

Now , assume you start reading a bitcode file over http. You get the header of the wrapper saying the size and ObjectSize is set.
After that  your network connection goes down and GetBytes will fail to read more data.

fetchToPos will incorrectly say that Pos can be read, no?

http://reviews.llvm.org/D8931

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list