Skip to content

Commit

Permalink
Improve function call return value handling
Browse files Browse the repository at this point in the history
Fix segfault caused by static cast and wrong type
Fixes sass#1269
  • Loading branch information
xzyfer committed Jul 8, 2015
1 parent 6f2252b commit 2dba175
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ namespace Sass {
break;
}
// otherwise move one of the rest args into the param, converting to argument if necessary
if (arglist->is_arglist()) {
a = static_cast<Argument*>((*arglist)[0]);
} else {
if (!(a = dynamic_cast<Argument*>((*arglist)[0]))) {
Expression* a_to_convert = (*arglist)[0];
a = new (ctx.mem) Argument(a_to_convert->pstate(),
a_to_convert,
Expand Down
6 changes: 2 additions & 4 deletions eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,8 @@ namespace Sass {
if (result->pstate().file == string::npos)
result->pstate(c->pstate());

do {
result->is_delayed(result->concrete_type() == Expression::STRING);
result = result->perform(this);
} while (result->concrete_type() == Expression::NONE);
result->is_delayed(result->concrete_type() == Expression::STRING);
if (!result->is_delayed()) result = result->perform(this);
return result;
}

Expand Down

0 comments on commit 2dba175

Please sign in to comment.