Add a fix to base/numerics so that code compiles for asmjs.

Bug: pdfium:1320
Change-Id: I6bfb7388db66cbce086f4687419c874ff56f4bb5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/55713
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/third_party/base/numerics/safe_math_shared_impl.h b/third_party/base/numerics/safe_math_shared_impl.h
index 3bda8823..6c2810c 100644
--- a/third_party/base/numerics/safe_math_shared_impl.h
+++ b/third_party/base/numerics/safe_math_shared_impl.h
@@ -17,11 +17,14 @@
 
 #include "third_party/base/numerics/safe_conversions.h"
 
+#ifdef __asmjs__
+// Optimized safe math instructions are incompatible with asmjs.
+#define BASE_HAS_OPTIMIZED_SAFE_MATH (0)
 // Where available use builtin math overflow support on Clang and GCC.
-#if ((defined(__clang__) &&                                \
-      ((__clang_major__ > 3) ||                            \
-       (__clang_major__ == 3 && __clang_minor__ >= 4))) || \
-     (defined(__GNUC__) && __GNUC__ >= 5))
+#elif ((defined(__clang__) &&                                \
+        ((__clang_major__ > 3) ||                            \
+         (__clang_major__ == 3 && __clang_minor__ >= 4))) || \
+       (defined(__GNUC__) && __GNUC__ >= 5))
 #include "third_party/base/numerics/safe_math_clang_gcc_impl.h"
 #define BASE_HAS_OPTIMIZED_SAFE_MATH (1)
 #else