[llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp

Reid Spencer reid at x10sys.com
Tue Aug 22 10:59:04 PDT 2006



Changes in directory llvm/lib/Bytecode/Archive:

ArchiveWriter.cpp updated: 1.26 -> 1.27
---
Log message:

Inverse the error check logic for the MappedFile::map() call. It returns 
a null pointer when there is an error.


---
Diffs of the changes:  (+1 -1)

 ArchiveWriter.cpp |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp
diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.26 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.27
--- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.26	Tue Aug 22 11:07:44 2006
+++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp	Tue Aug 22 12:58:50 2006
@@ -209,7 +209,7 @@
     mFile = new sys::MappedFile();
     if (mFile->open(member.getPath(), sys::MappedFile::READ_ACCESS, &ErrMsg))
       throw ErrMsg;
-    if (data = (const char*) mFile->map(&ErrMsg))
+    if (!(data = (const char*) mFile->map(&ErrMsg)))
       throw ErrMsg;
     fSize = mFile->size();
   }






More information about the llvm-commits mailing list