Skip to content

Commit 84aa50e

Browse files
committed
memory leak checked
1 parent 75c8547 commit 84aa50e

File tree

8 files changed

+7
-103
lines changed

8 files changed

+7
-103
lines changed

1-Lab/itmo-comp-arch22-lab1-Ismaxis

Lines changed: 0 additions & 1 deletion
This file was deleted.

1-Lab/logisim-evolution-3.8.0-all.jar

25.1 MB
Binary file not shown.

3-Lab/ElfParser.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ void ElfParser::parse() {
7272
}
7373
}
7474

75-
file.close();
7675
delete[] buff;
7776
}
7877

3-Lab/Instruction.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ class Instruction {
4343
};
4444

4545
template <typename T>
46-
std::string Instruction::toHexString(T number)
47-
{
46+
std::string Instruction::toHexString(T number) {
4847
std::ostringstream ss;
4948
ss << std::setfill('0') << std::setw(sizeof(T) * 2) << std::hex << number;
50-
return ss.str();
49+
return ss.str();
5150
}

3-Lab/Types/BType.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,6 @@ class BType : public Instruction {
3030
return toHexString(address + imm);
3131
}
3232

33-
// static void printBin(uint32_t bits) { // TODO remove
34-
// std::cout << '\n';
35-
// for (int i = 31; i >= 0; i--) {
36-
// if (i % 4 == 3) {
37-
// std::cout << ' ';
38-
// }
39-
// std::cout << isBitSet(bits, i) ? '1' : '0';
40-
// }
41-
// std::cout << '\n';
42-
// }
43-
4433
std::string getMnemonic() const {
4534
return mnemonics[parseFunct3(bits)];
4635
}

3-Lab/Types/JType.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class JType : public Instruction {
55
public:
6-
explicit JType(uint32_t bits) : Instruction(bits) {}
6+
explicit JType(uint32_t bits) : Instruction(bits) {}
77
~JType() override = default;
88

99
private:
@@ -29,7 +29,7 @@ class JType : public Instruction {
2929
return toHexString(address + imm);
3030
}
3131

32-
std::string getMnemonic() const {
32+
static std::string getMnemonic() {
3333
return "jal";
3434
}
3535
};

3-Lab/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ int main(const int argc, char const* argv[]) {
3131
std::cout << "Can't open input file";
3232
return 0;
3333
}
34+
3435
ElfParser* parser = parseFile(input);
3536
input.close();
3637

@@ -39,9 +40,11 @@ int main(const int argc, char const* argv[]) {
3940
std::cout << "Can't open output file";
4041
return 0;
4142
}
43+
4244
parser->printDotText(output);
4345
fprintf(output, "\n");
4446
parser->printSymtab(output);
47+
4548
fclose(output);
4649
delete parser;
4750
return 0;

3-Lab/resources/newOut.s

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)