1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-30 06:59:03 +01:00
Commit Graph

2 Commits

Author SHA1 Message Date
nsf
1a2066b87e Properly handle variadic functions.
This commit addresses two issues:

1. For variadic functions 'convertCallArguments' was allocating exactly
   'len(args)' arguments, which might be less than required, as a result
   zero/default filling loop would panic with out of bounds error.

2. Even if we correctly allocate a proper amount of arguments, zero/default
   filling loop doesn't handle special variadic function type case, when last
   argument has a slice type and reflect API expects plain values as arguments.
   But actually we don't need that, because it's okay to omit variadic values
   altogether, hence the total amount of allocated arguments is
   max(len(args), rt.NumIn()-1).
2018-05-30 19:44:29 +05:00
Oliver Steele
6269836192 Move pkg evaluator -> values 2017-07-27 18:11:37 -04:00