Summary: To meet the pure parts of formulas, the process was to (a) call Rename.extend with variables occuring in similar places and (b) extract substitutions out of those. Two matching primed vars would both be replaced by some fresh primed var. However, equivalence classes of primed variables would *not* be replaced by one fresh (primed) variable. Now, that should work. Reviewed By: mbouaziz Differential Revision: D14150192 fbshipit-source-id: 90ca9216cmaster
parent
88a1dedb90
commit
86861498a5
@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
#include <memory.h>
|
||||||
|
#define size_t int
|
||||||
|
#define off_t int
|
||||||
|
|
||||||
|
struct foo { // globals are treated differntly
|
||||||
|
|
||||||
|
char * memory_;
|
||||||
|
size_t memory_size_;
|
||||||
|
|
||||||
|
bool ReadBytes(void *buffer, size_t size, off_t offset) {
|
||||||
|
if (memory_) {
|
||||||
|
if (offset < 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (offset + size >= memory_size_) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
memcpy(buffer, memory_ + offset, size);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void FindHeader(off_t &offset) {
|
||||||
|
int magic;
|
||||||
|
ReadBytes(&magic, sizeof(magic), 0);
|
||||||
|
ReadBytes(&magic, sizeof(magic), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void fail(char * x) {
|
||||||
|
if (x == 0) {
|
||||||
|
*x = 'a';
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue