Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index eb6cbe0c9fded1e381f10aeb0238bf9c53b873a8..e97c94d175a6f1c2a8f2febbd29c290227aaa29d 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -3725,6 +3725,11 @@ HInstruction* HGraphBuilder::BuildStoreKeyedSpecializedArrayElement( |
HLoadExternalArrayPointer* external_elements = |
new(zone()) HLoadExternalArrayPointer(elements); |
AddInstruction(external_elements); |
+ if (expr->external_array_type() == kExternalPixelArray) { |
+ HClampToUint8* clamp = new(zone()) HClampToUint8(val); |
+ AddInstruction(clamp); |
+ val = clamp; |
+ } |
return new(zone()) HStoreKeyedSpecializedArrayElement( |
external_elements, |
key, |