search for 'main' explicitly

Change-Id: Ie88b935a75d8b9c253b29bf0aa4ef39649327bfa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228119
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h
index 0339819..845d0e6 100644
--- a/src/core/SkRasterPipeline.h
+++ b/src/core/SkRasterPipeline.h
@@ -156,8 +156,8 @@
 }
 
 struct SkRasterPipeline_InterpreterCtx {
-    SkSL::ByteCode*         byteCode;
-    SkSL::ByteCodeFunction* fn;
+    const SkSL::ByteCode*         byteCode;
+    const SkSL::ByteCodeFunction* fn;
 
     SkColor4f   paintColor;
     const void* inputs;
diff --git a/src/shaders/SkRTShader.cpp b/src/shaders/SkRTShader.cpp
index 565d7bc..275e029 100644
--- a/src/shaders/SkRTShader.cpp
+++ b/src/shaders/SkRTShader.cpp
@@ -67,9 +67,12 @@
             return false;
         }
         SkASSERT(fByteCode);
+        if (!fByteCode->getFunction("main")) {
+            return false;
+        }
     }
     ctx->byteCode = fByteCode.get();
-    ctx->fn = ctx->byteCode->fFunctions[0].get();
+    ctx->fn = ctx->byteCode->getFunction("main");
 
     rec.fPipeline->append(SkRasterPipeline::seed_shader);
     rec.fPipeline->append(SkRasterPipeline::interpreter, ctx);