summaryrefslogtreecommitdiffstats
path: root/include/bcinfo
diff options
context:
space:
mode:
Diffstat (limited to 'include/bcinfo')
-rw-r--r--include/bcinfo/Wrap/bitcode_wrapperer.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/bcinfo/Wrap/bitcode_wrapperer.h b/include/bcinfo/Wrap/bitcode_wrapperer.h
index 2fbce21..97f6294 100644
--- a/include/bcinfo/Wrap/bitcode_wrapperer.h
+++ b/include/bcinfo/Wrap/bitcode_wrapperer.h
@@ -101,7 +101,13 @@ class BitcodeWrapperer {
void FillBuffer();
// Returns the number of bytes in infile.
- off_t GetInFileSize() { return infile_->Size(); }
+ off_t GetInFileSize() {
+ if (infile_ != NULL) {
+ return infile_->Size();
+ } else {
+ return 0;
+ }
+ }
// Returns the offset of bitcode (i.e. the size of the wrapper header)
// if the output file were to be written now.