@Test public void testMakeStructMemberArrayAccessInBounds1() throws Exception { final String shader = "#version 310 es\n" + "struct S {\n" + " int A[3];\n" + "};\n" + "void main() {\n" + " int x;\n" + " x = 22;\n" + " S myS;\n" + " myS.A[x] = 6;\n" + "}\n"; final String expected = "#version 310 es\n" + "struct S {\n" + " int A[3];\n" + "};\n" + "void main() {\n" + " int x;\n" + " x = 22;\n" + " S myS;\n" + " myS.A[" + Constants.GLF_MAKE_IN_BOUNDS_INT + "(x, 3)] = 6;\n" + "}\n"; final TranslationUnit tu = ParseHelper.parse(shader); MakeArrayAccessesInBounds.makeInBounds(tu); CompareAsts.assertEqualAsts(expected, tu); }
public static void makeInBounds(TranslationUnit tu) { new MakeArrayAccessesInBounds(new Typer(tu)).visit(tu); }
MakeArrayAccessesInBounds extends ScopeTrackingVisitor { public static void makeInBounds(TranslationUnit tu) { new MakeArrayAccessesInBounds(new Typer(tu)).visit(tu); } }
MakeArrayAccessesInBounds extends ScopeTrackingVisitor { public static void makeInBounds(TranslationUnit tu) { new MakeArrayAccessesInBounds(new Typer(tu)).visit(tu); } private  MakeArrayAccessesInBounds(Typer typer); }
MakeArrayAccessesInBounds extends ScopeTrackingVisitor { public static void makeInBounds(TranslationUnit tu) { new MakeArrayAccessesInBounds(new Typer(tu)).visit(tu); } private  MakeArrayAccessesInBounds(Typer typer); static void makeInBounds(TranslationUnit tu); static void makeInBounds(ShaderJob shaderJob); @Override void visitArrayIndexExpr(ArrayIndexExpr arrayIndexExpr); }
MakeArrayAccessesInBounds extends ScopeTrackingVisitor { public static void makeInBounds(TranslationUnit tu) { new MakeArrayAccessesInBounds(new Typer(tu)).visit(tu); } private  MakeArrayAccessesInBounds(Typer typer); static void makeInBounds(TranslationUnit tu); static void makeInBounds(ShaderJob shaderJob); @Override void visitArrayIndexExpr(ArrayIndexExpr arrayIndexExpr);  }