Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Fix a memory corruption #6

Merged
merged 9 commits into from
Mar 12, 2014
Prev Previous commit
Next Next commit
Actually use cache.
Previously the condition to use cache is never met.
  • Loading branch information
zcbenz committed Mar 12, 2014
commit 9b70069cc36ffb4a7e057749a7e8c7eeb5a435c5
2 changes: 1 addition & 1 deletion src/onig-scanner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Handle<Value> OnigScanner::FindNextMatch(Handle<String> v8String, Handle<Number>
bool useCachedResult = false;
shared_ptr<OnigResult> result;

if (useCachedResults && index <= maxCachedIndex) {
if (index <= maxCachedIndex) {
result = cachedResults[index];
useCachedResult = (!result || result->LocationAt(0) >= charOffset);
}
Expand Down