Skip to content

Commit

Permalink
fix _sym_get_input_byte
Browse files Browse the repository at this point in the history
  • Loading branch information
ercoppa committed Mar 24, 2023
1 parent e72245a commit 7f80953
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions runtime/simple_backend/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ Z3_ast _sym_build_float(double value, int is_double) {
Z3_ast _sym_get_input_byte(size_t offset, uint8_t) {
static std::vector<SymExpr> stdinBytes;

if (offset < stdinBytes.size())
if (offset < stdinBytes.size() && stdinBytes[offset])
return stdinBytes[offset];

auto varName = "stdin" + std::to_string(stdinBytes.size());
auto varName = "stdin" + std::to_string(offset);
auto *var = build_variable(varName.c_str(), 8);

stdinBytes.resize(offset);
stdinBytes.push_back(var);
stdinBytes.resize(offset + 1);
stdinBytes[offset] = var;

return var;
}
Expand Down

0 comments on commit 7f80953

Please sign in to comment.