Fix crash if a file tries to pass arguments to a macro defined via --preprocess-defines
This commit is contained in:
parent
e9a6b95fd8
commit
8d9d5b7b2d
1 changed files with 2 additions and 1 deletions
|
@ -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_);
|
||||
|
|
Loading…
Add table
Reference in a new issue