<commit_before>/* A BlockEnvironment is created when a block is created. Its primary
 * operation is call, which activates the code associated with the block. */

#include "block_environment.hpp"
#include "objectmemory.hpp"

#include "builtin/compiledmethod.hpp"
#include "builtin/contexts.hpp"
#include "builtin/fixnum.hpp"
#include "builtin/symbol.hpp"
#include "builtin/task.hpp"
#include "builtin/tuple.hpp"

namespace rubinius {
  void BlockEnvironment::call(STATE, Task* task, size_t args) {
    OBJECT val;
    if(args > 0) {
      Tuple* tup = Tuple::create(state, args);
      for(size_t i = args - 1; i >= 0; i--) {
        tup->put(state, i, task->pop());
      }

      val = tup;
    } else {
      val = Qnil;
    }
    task->pop(); // Remove this from the stack.
    BlockContext* ctx = create_context(state, task->active);
    task->make_active(ctx);
    task->push(val);<commit_msg>Don't wrap around to MAX_INT for comparison<commit_after>/* A BlockEnvironment is created when a block is created. Its primary
 * operation is call, which activates the code associated with the block. */

#include "block_environment.hpp"
#include "objectmemory.hpp"

#include "builtin/compiledmethod.hpp"
#include "builtin/contexts.hpp"
#include "builtin/fixnum.hpp"
#include "builtin/symbol.hpp"
#include "builtin/task.hpp"
#include "builtin/tuple.hpp"

namespace rubinius {
  void BlockEnvironment::call(STATE, Task* task, size_t args) {
    OBJECT val;
    if(args > 0) {
      Tuple* tup = Tuple::create(state, args);
      for(int i = args - 1; i >= 0; i--) {
        tup->put(state, i, task->pop());
      }

      val = tup;
    } else {
      val = Qnil;
    }
    task->pop(); // Remove this from the stack.
    BlockContext* ctx = create_context(state, task->active);
    task->make_active(ctx);
    task->push(val);
{'fraction_non_alphanumeric': 0.13972602739726028, 'fraction_numerical': 0.0032876712328767125, 'mean_word_length': 3.33729216152019, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6417173', 'n_tokens_mistral': 599, 'n_tokens_neox': 595, 'n_words': 169}