Skip to content

Commit c7a2c90

Browse files
committed
fix vector exception
1 parent 800e8ea commit c7a2c90

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ To install or update LODA, please follow the [installation instructions](https:/
22

33
## [Unreleased]
44

5+
## v22.12.6
6+
7+
### Bugfixes
8+
9+
* Fix vector exception
10+
11+
### Enhancements
12+
13+
* Increase maximum number of cycles to 30 million
14+
15+
## v22.12.2
16+
517
### Enhancements
618

719
* Increase default OEIS update interval

miners.default.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{
2020
"name": "update",
2121
"overwrite": "auto",
22-
"enabled": false,
22+
"enabled": true,
2323
"backoff": true,
2424
"generators": [
2525
"v2",

src/include/util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Settings {
2020
public:
2121
static constexpr size_t DEFAULT_NUM_TERMS = 10;
2222
static constexpr int64_t DEFAULT_MAX_MEMORY = 1000;
23-
static constexpr int64_t DEFAULT_MAX_CYCLES = 25000000;
23+
static constexpr int64_t DEFAULT_MAX_CYCLES = 30000000;
2424

2525
size_t num_terms;
2626
int64_t max_memory;

src/stats.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,15 @@ int64_t Stats::getTransitiveLength(size_t id) const {
474474
visited_programs.clear();
475475
if (printed_recursion_warning.find(id) == printed_recursion_warning.end()) {
476476
printed_recursion_warning.insert(id);
477-
Log::get().warn("Recursion detected in stats for " +
478-
OeisSequence(id).getProgramPath());
477+
Log::get().warn("Recursion detected: " + OeisSequence(id).id_str());
479478
}
480479
return -1;
481480
}
482481
visited_programs.insert(id);
482+
if (id >= program_lengths.size()) {
483+
Log::get().warn("Invalid reference: " + OeisSequence(id).id_str());
484+
return -1;
485+
}
483486
int64_t length = program_lengths.at(id);
484487
auto range = call_graph.equal_range(id);
485488
for (auto &it = range.first; it != range.second; it++) {

0 commit comments

Comments
 (0)