diff --git a/vyper/parser/expr.py b/vyper/parser/expr.py
index <HASH>..<HASH> 100644
--- a/vyper/parser/expr.py
+++ b/vyper/parser/expr.py
@@ -493,8 +493,9 @@ class Expr:
                 ["add", ["sha3_32", right], ["mload", MemoryPositions.FREE_LOOP_INDEX]],
             ]
         else:
+            load_operation = "mload" if right.location == "memory" else "calldataload"
             load_i_from_list = [
-                "mload",
+                load_operation,
                 ["add", right, ["mul", 32, ["mload", MemoryPositions.FREE_LOOP_INDEX]]],
             ]
fix: calldata array for in comparator