Skip to content

Commit

Permalink
Fix segfault in mix and max functions
Browse files Browse the repository at this point in the history
  • Loading branch information
xzyfer committed Jun 9, 2015
1 parent c93ffcb commit b057494
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1051,8 +1051,8 @@ namespace Sass {
Number* least = 0;
for (size_t i = 0, L = arglist->length(); i < L; ++i) {
Number* xi = dynamic_cast<Number*>(arglist->value_at_index(i));
if (!xi) error("`" + string(sig) + "` only takes numeric arguments", pstate);
if (least) {
if (!xi) error("`" + string(sig) + "` only takes numeric arguments", pstate);
if (lt(xi, least, ctx)) least = xi;
} else least = xi;
}
Expand All @@ -1066,8 +1066,8 @@ namespace Sass {
Number* greatest = 0;
for (size_t i = 0, L = arglist->length(); i < L; ++i) {
Number* xi = dynamic_cast<Number*>(arglist->value_at_index(i));
if (!xi) error("`" + string(sig) + "` only takes numeric arguments", pstate);
if (greatest) {
if (!xi) error("`" + string(sig) + "` only takes numeric arguments", pstate);
if (lt(greatest, xi, ctx)) greatest = xi;
} else greatest = xi;
}
Expand Down

0 comments on commit b057494

Please sign in to comment.