diff --git a/libasn1compiler/asn1c_constraint.c b/libasn1compiler/asn1c_constraint.c
index 78097838e42bd7c0bff1340da3ba7a4e24843c51..4550c52a51bc3624b9fbfbcba9acddb46c8aa4ba 100644
--- a/libasn1compiler/asn1c_constraint.c
+++ b/libasn1compiler/asn1c_constraint.c
@@ -175,7 +175,7 @@ asn1c_emit_constraint_checking_code(arg_t *arg) {
 			OUT("/* SEQUENCE validation code is the same as SET */\n");
 		case ASN_CONSTR_SET_OF:
 			OUT("/* Perform validation of the inner elements */\n");
-			OUT("return SET_OF_constraint(td, list, app_errlog, app_key);\n");
+			OUT("return SET_OF_constraint(td, sptr, app_errlog, app_key);\n");
 			break;
 		default:
 			OUT("/* Constraint check succeeded */\n");