Permalink
Browse files

make sure evaluating a Range's begin at first. fix #1495

  • Loading branch information...
1 parent 5ad5ef9 commit cf2d0565bef01ec5ebbca715a6f328ce3434fc68 @Watson1978 Watson1978 committed Apr 5, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 compiler.cpp
View
@@ -4296,10 +4296,14 @@ RoxorCompiler::compile_node0(NODE *node)
case NODE_DOT2:
case NODE_DOT3:
- assert(node->nd_beg != NULL);
- assert(node->nd_end != NULL);
- return compile_range(compile_node(node->nd_beg),
- compile_node(node->nd_end), nd_type(node) == NODE_DOT3);
+ {
+ assert(node->nd_beg != NULL);
+ assert(node->nd_end != NULL);
+ Value *beg = compile_node(node->nd_beg);
+ Value *end = compile_node(node->nd_end);
+ return compile_range(beg, end, nd_type(node) == NODE_DOT3);
+ }
+ break;
case NODE_FLIP2:
case NODE_FLIP3:

0 comments on commit cf2d056

Please sign in to comment.