diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-02-10 15:26:15 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-02-10 15:26:15 (GMT) |
commit | 63c1154f8e434da1988dccac4101a51271083fe2 (patch) | |
tree | e174501a97325e266705cd7806b8327296851cd8 /src/expr.cc | |
parent | 8038ee0406c05b1bc9c147e47a7ae8c02da6afbf (diff) |
Fixed crash when using negative array indices
git-svn-id: http://svn.clifford.at/openscad/trunk@433 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/expr.cc')
-rw-r--r-- | src/expr.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/expr.cc b/src/expr.cc index 35fc776..23bcc32 100644 --- a/src/expr.cc +++ b/src/expr.cc @@ -81,7 +81,7 @@ Value Expression::evaluate(const Context *context) const Value v2 = children[1]->evaluate(context); if (v1.type == Value::VECTOR && v2.type == Value::NUMBER) { int i = (int)(v2.num); - if (i < v1.vec.size()) + if (i >= 0 && i < v1.vec.size()) return *v1.vec[i]; } return Value(); |