Skip to content

Commit 95dfb25

Browse files
committed
Implementation of Return Value Check
- Fixed error where sumIntraInstructions wasn't properly updated and crashed the execution of the program - Implemented Return Value Check - Standardized some notation in order to have better formatted and more readable code
1 parent 567d46b commit 95dfb25

File tree

8 files changed

+276
-263
lines changed

8 files changed

+276
-263
lines changed

passes/ASPIS.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -176,24 +176,25 @@ class RACFED : public PassInfoMixin<RACFED> {
176176
GlobalVariable *RuntimeSigGV, Type *IntType);
177177

178178
// --- CHECK BLOCKS AT JUMP END ---
179-
void checkCompileTimeSigAtJump(Module &Md, Function &Fn,
180-
GlobalVariable *RuntimeSigGV, Type *IntType);
179+
void checkCompileTimeSigAtJump(Module &Md, Function &Fn, BasicBlock &BB,
180+
GlobalVariable *RuntimeSigGV, Type *IntType,
181+
BasicBlock &ErrBB);
181182

182183
// --- UPDATE BRANCH SIGNATURE BEFORE JUMP ---
184+
void checkBranches(Module &Md, BasicBlock &BB, GlobalVariable *RuntimeSigGV,
185+
Type *IntType);
183186

184-
void checkBranches(Module &Md, GlobalVariable *RuntimeSigGV, Type *IntType,
185-
IRBuilder<> B, BasicBlock &BB);
186-
187-
void splitBBsAtCalls(Module &Md);
188-
// int countOriginalInstructions(BasicBlock &BB);
189-
CallBase *isCallBB(BasicBlock &BB);
190-
void initializeEntryBlocksMap(Module &Md);
191-
Value *getCondition(Instruction &I);
192-
// void createCFGVerificationBB(BasicBlock &BB,
193-
// std::unordered_map<BasicBlock *, int> &RandomNumberBBs,
194-
// std::unordered_map<BasicBlock *, int> &SubRanPrevVals,
195-
// Value &RuntimeSig, Value &RetSig,
196-
// BasicBlock &ErrBB);
187+
// --- UPDATE RETURN VALUE AND CHECK ---
188+
void checkReturnValue(Module &Md, Function &Fn, BasicBlock &BB,
189+
GlobalVariable *RuntimeSigGV,
190+
Type *IntType, BasicBlock &ErrBB,
191+
Value *BckupRunSig);
192+
193+
194+
// void splitBBsAtCalls(Module &Md);
195+
// CallBase *isCallBB(BasicBlock &BB);
196+
// void initializeEntryBlocksMap(Module &Md);
197+
// Value *getCondition(Instruction &I);
197198

198199
public:
199200
PreservedAnalyses run(Module &Md, ModuleAnalysisManager &);

0 commit comments

Comments
 (0)