File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 22
22
- run : rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
23
23
- run : cargo build --verbose
24
24
- run : cargo test --verbose
25
+
26
+ build_script :
27
+ name : Rust project - build script
28
+ runs-on : ubuntu-latest
29
+ steps :
30
+ - uses : actions/checkout@v3
31
+ - run : chmod +x build.sh
32
+ - run : ./build.sh
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ use super::apply_builtin;
9
9
10
10
/// Call a function with the given number of arguments.
11
11
/// First it pops n values from the operand stack where n is the arity of the function.
12
+ /// The values will be the arguments to the function and they are pushed to a vector and reversed.
13
+ /// i.e. the last argument is the top value of the operand stack.
12
14
/// Then it pops the closure from the operand stack.
13
15
/// It checks that the closure is a closure and that the arity of the closure matches the number of arguments.
14
16
/// If the closure is a builtin function it applies the builtin function and returns.
@@ -28,6 +30,7 @@ use super::apply_builtin;
28
30
/// If the closure is not of type closure or the arity of the closure does not match the number of arguments.
29
31
pub fn call ( mut rt : Runtime , arity : usize ) -> Result < Runtime > {
30
32
let mut args = Vec :: new ( ) ;
33
+ args. reserve_exact ( arity) ;
31
34
32
35
for _ in 0 ..arity {
33
36
args. push (
@@ -38,6 +41,8 @@ pub fn call(mut rt: Runtime, arity: usize) -> Result<Runtime> {
38
41
) ;
39
42
}
40
43
44
+ args. reverse ( ) ;
45
+
41
46
let value = rt
42
47
. current_thread
43
48
. operand_stack
You can’t perform that action at this time.
0 commit comments