Class SanitizationInjector
For each call parameter marked SANITIZED_REQUIRED (the as sanitized String
modifier), emits SanitizeInstr to produce a NEW sanitised object, RETAIN + SCOPE_REGISTER
it for LLVM ARC (the JVM backend ignores the memory ops — GC handles memory), and replaces the
matching argument variable in-place with the sanitised temp.
This consolidates five previously-divergent copies (CallInstrGenerator ×2,
ObjectAccessInstrGenerator, ConstructorCallProcessor, FunctionCallProcessor). The loop is bounded
by BOTH parameters.size() and arguments.size(): a parameter with no matching
argument is skipped rather than driving an arguments.get(i) out-of-bounds — three of the
former copies omitted that bound. Only a parameter that both HAS a supplied argument and is marked
sanitised is ever rewritten, so this is behaviour-identical to the guarded copies and strictly
safer than the unguarded ones.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidinject(IRGenerationContext stackContext, List<ISymbol> parameters, List<String> arguments, List<IRInstr> instructions) Inject SANITIZE (+ ARC memory ops) for everySANITIZED_REQUIREDparameter that has a supplied argument, rewriting that argument inargumentsto the sanitised temp.
-
Method Details
-
inject
public static void inject(IRGenerationContext stackContext, List<ISymbol> parameters, List<String> arguments, List<IRInstr> instructions) Inject SANITIZE (+ ARC memory ops) for everySANITIZED_REQUIREDparameter that has a supplied argument, rewriting that argument inargumentsto the sanitised temp.- Parameters:
stackContext- the IR generation context (temp names + current scope)parameters- the resolved call parameters to check for the sanitisation markerarguments- the argument variable names (modified in place)instructions- the instruction list to inject into
-