diff options
Diffstat (limited to 'project2/ice/sliceCompile.cpp')
-rw-r--r-- | project2/ice/sliceCompile.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/project2/ice/sliceCompile.cpp b/project2/ice/sliceCompile.cpp index 0544aea..53832c9 100644 --- a/project2/ice/sliceCompile.cpp +++ b/project2/ice/sliceCompile.cpp @@ -18,11 +18,14 @@ SliceCompile::build(const boost::filesystem::path & in, FILE * out) const Slice::PreprocessorPtr icecpp = Slice::Preprocessor::create("slice2project2", in.string(), cppArgs); FILE * cppHandle = icecpp->preprocess(false); - if (cppHandle == NULL) { + if (!cppHandle) { throw std::runtime_error("preprocess failed"); } Slice::UnitPtr u = Slice::Unit::createUnit(false, false, false, false); + if (!u) { + throw std::runtime_error("create unit failed"); + } AdHoc::ScopeExit uDestroy(boost::bind(&Slice::Unit::destroy, u.get())); int parseStatus = u->parse(in.string(), cppHandle, false); |