~ubuntu-branches/ubuntu/trusty/rlvm/trusty-proposed

« back to all changes in this revision

Viewing changes to src/MachineBase/Memory.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ying-Chun Liu (PaulLiu)
  • Date: 2011-02-06 16:29:39 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110206162939-hornnn34hotm3rg9
Tags: 0.10-1
* New upstream release
  - Tomoyo After Memorial Edition support.
  - Planetarian voice support.
  - Fix multiple errors in the handling of glosses.
  - Multiple crashers/graphics fixes.
* Remove 003_port_to_gtest1.4.0.patch: Use google-mock now.
* Add 002_fix_missing_include.patch: Fix missing include of header files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
  int_var[5] = local_.intF;
117
117
  int_var[6] = global_->intG;
118
118
  int_var[7] = global_->intZ;
 
119
 
 
120
  original_int_var[0] = &local_.original_intA;
 
121
  original_int_var[1] = &local_.original_intB;
 
122
  original_int_var[2] = &local_.original_intC;
 
123
  original_int_var[3] = &local_.original_intD;
 
124
  original_int_var[4] = &local_.original_intE;
 
125
  original_int_var[5] = &local_.original_intF;
 
126
  original_int_var[6] = NULL;
 
127
  original_int_var[7] = NULL;
119
128
}
120
129
 
121
130
const std::string& Memory::getStringValue(int type, int location) {
159
168
  case STRM_LOCATION:
160
169
    global_->strM[number] = value;
161
170
    break;
162
 
  case STRS_LOCATION:
 
171
  case STRS_LOCATION: {
 
172
    // Possibly record the orriginal value for a piece of local memory.
 
173
    std::map<int, std::string>::iterator it = local_.original_strS.find(number);
 
174
    if (it == local_.original_strS.end()) {
 
175
      local_.original_strS.insert(std::make_pair(number, local_.strS[number]));
 
176
    }
163
177
    local_.strS[number] = value;
164
178
    break;
 
179
  }
165
180
  default:
166
181
    throw rlvm::Exception("Invalid type in RLMachine::set_string_value");
167
182
  }
214
229
  bitset[kidoku] = true;
215
230
}
216
231
 
 
232
void Memory::takeSavepointSnapshot() {
 
233
  local_.original_intA.clear();
 
234
  local_.original_intB.clear();
 
235
  local_.original_intC.clear();
 
236
  local_.original_intD.clear();
 
237
  local_.original_intE.clear();
 
238
  local_.original_intF.clear();
 
239
  local_.original_strS.clear();
 
240
}
 
241
 
217
242
// static
218
243
int Memory::ConvertLetterIndexToInt(const std::string& value) {
219
244
  int total = 0;