Avoid making a constructor with a $literal type.

While working on an unrelated fix, I noticed that Ossfuzz28904.sksl has
an expression which generates a constructor of $literal type: `-2 .L1`

This shouldn't ever happen, so the code is now fixed to avoid it. This
doesn't affect any of the output from our existing tests. (In that
oss-fuzz test, that literal constructor is immediately expanded out to
an ivec2 by the swizzle, at which point it loses its $literal status
anyway.)

Change-Id: I34d1b0ad9e7c25987119d3337f4bb9e7b8a5619c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376617
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
diff --git a/src/sksl/ir/SkSLConstructor.cpp b/src/sksl/ir/SkSLConstructor.cpp
index c22429a..55864f0 100644
--- a/src/sksl/ir/SkSLConstructor.cpp
+++ b/src/sksl/ir/SkSLConstructor.cpp
@@ -26,7 +26,7 @@
         return std::move(args[0]);
     }
     if (type.isScalar()) {
-        return MakeScalarConstructor(context, offset, type, std::move(args));
+        return MakeScalarConstructor(context, offset, type.scalarTypeForLiteral(), std::move(args));
     }
     if (type.isVector() || type.isMatrix()) {
         return MakeCompoundConstructor(context, offset, type, std::move(args));