From 8ac18e651787d5a8aadff07dd08fb010296701d6 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Wed, 8 Dec 2021 13:14:42 +0100 Subject: [PATCH] convert to Integer before using .times --- lib/core/stack.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/stack.rb b/lib/core/stack.rb index a7adf63..262bdf4 100644 --- a/lib/core/stack.rb +++ b/lib/core/stack.rb @@ -59,7 +59,7 @@ module Rpl # duplicate n first stack entries def dupn( stack, dictionary ) stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[numeric]] ) - n = args[0][:value] + n = args[0][:value].to_i stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any] * args[0][:value] ) args.reverse! @@ -76,7 +76,7 @@ module Rpl # push a copy of the given stack level onto the stack def pick( stack, dictionary ) stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[numeric]] ) - n = args[0][:value] + n = args[0][:value].to_i stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any] * args[0][:value] ) args.reverse!