Commit 8583f02b authored by Widagdo Setiawan's avatar Widagdo Setiawan Committed by Facebook Github Bot

Fix signed/unsigned mismatch in json.cpp

Summary: Fix signed/unsigned mismatch in json.cpp

Reviewed By: yfeldblum, jdonald

Differential Revision: D19671088

fbshipit-source-id: 4bc1f4111e0536aa22c7fd03a2a6a6d786b7cfc8
parent 9d426db1
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/Unicode.h> #include <folly/Unicode.h>
#include <folly/Utility.h>
#include <folly/lang/Bits.h> #include <folly/lang/Bits.h>
#include <folly/portability/Constexpr.h> #include <folly/portability/Constexpr.h>
...@@ -758,7 +759,7 @@ void escapeStringImpl( ...@@ -758,7 +759,7 @@ void escapeStringImpl(
// it literally into the output string. // it literally into the output string.
auto firstEsc = p; auto firstEsc = p;
while (firstEsc < e) { while (firstEsc < e) {
auto avail = e - firstEsc; auto avail = to_unsigned(e - firstEsc);
uint64_t word = 0; uint64_t word = 0;
if (avail >= 8) { if (avail >= 8) {
word = folly::loadUnaligned<uint64_t>(firstEsc); word = folly::loadUnaligned<uint64_t>(firstEsc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment