MCPcopy Create free account
hub / github.com/csmith-project/csmith / add_external_effect

Method add_external_effect

src/Effect.cpp:219–245  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

217 *
218 */
219void
220Effect::add_external_effect(const Effect &e)
221{
222 if (this == &e) {
223 return;
224 }
225
226 vector<Variable *>::size_type len;
227 vector<Variable *>::size_type i;
228
229 len = e.read_vars.size();
230 for (i = 0; i < len; ++i) {
231 if (e.read_vars[i]->is_global()) {
232 this->read_var(e.read_vars[i]);
233 }
234 }
235
236 len = e.write_vars.size();
237 for (i = 0; i < len; ++i) {
238 if (e.write_vars[i]->is_global()) {
239 this->write_var(e.write_vars[i]);
240 //Make sure the "purity" is set correctly
241 this->pure = false;
242 }
243 }
244 side_effect_free &= e.side_effect_free;
245}
246
247/*
248 * with call chains, we want to track write/read to stack

Callers 6

GenerateBodyMethod · 0.45
compute_summaryMethod · 0.45
build_invocationMethod · 0.45
revisitMethod · 0.45
visit_factsMethod · 0.45

Calls 5

read_varMethod · 0.95
write_varMethod · 0.95
sizeMethod · 0.80
is_globalMethod · 0.45
is_var_on_stackMethod · 0.45

Tested by

no test coverage detected