Skip to content

Commit

Permalink
Fix crash if a file tries to pass arguments to a macro defined via --…
Browse files Browse the repository at this point in the history
…preprocess-defines
  • Loading branch information
CelticMinstrel committed Nov 18, 2018
1 parent e9a6b95 commit 8d9d5b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/serialization/preprocessor.cpp
Expand Up @@ -1566,8 +1566,9 @@ bool preprocessor_data::get_chunk()

if(nb_arg - optional_arg_num != val.arguments.size()) {
const std::vector<std::string>& locations = utils::quoted_split(val.location, ' ');
const std::string filename = locations.empty() ? "<command-line>" : get_filename(locations[0]);
std::ostringstream error;
error << "Preprocessor symbol '" << symbol << "' defined at " << get_filename(locations[0]) << ":"
error << "Preprocessor symbol '" << symbol << "' defined at " << filename << ":"
<< val.linenum << " expects " << val.arguments.size() << " arguments, but has "
<< nb_arg - optional_arg_num << " arguments";
parent_.error(error.str(), linenum_);
Expand Down

0 comments on commit 8d9d5b7

Please sign in to comment.