Shopify / liquid-c

Liquid performance extension in C.
MIT License
119 stars 24 forks source link

Fix filter error translation for context evaluate of variable expression #143

Closed dylanahsmith closed 3 years ago

dylanahsmith commented 3 years ago

Problem

https://github.com/shopify/liquid-c/pull/115 fixed ArgumentError translation for Liquid::Variable#render, but Liquid::Context#evaluate was still doing a direct function call in C to the implementation of Liquid::C::Expression#evaluate. As a result, the error was still not being translated properly.

Solution

The first commit refactors the variable expression evaluation to provide an internal_variable_expression_evaluate function for context.c.

The second commit fixes the bug by checking the class in context_evaluate to call internal_variable_expression_evaluate for a cLiquidCVariableExpression.