From cdfff1a18d2203b8493f8700ab694c1c05ef6161 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 16 Dec 2018 20:52:47 -0800 Subject: 4869 --- html/subx/032check_operand_bounds.cc.html | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'html/subx/032check_operand_bounds.cc.html') diff --git a/html/subx/032check_operand_bounds.cc.html b/html/subx/032check_operand_bounds.cc.html index c5d90760..b22414d2 100644 --- a/html/subx/032check_operand_bounds.cc.html +++ b/html/subx/032check_operand_bounds.cc.html @@ -75,30 +75,30 @@ if ('onhashchange' in window) { 9 :(before "End Globals") 10 map<string, uint32_t> Operand_bound; 11 :(before "End One-time Setup") -12 put_new(Operand_bound, "subop", 1<<3); -13 put_new(Operand_bound, "mod", 1<<2); -14 put_new(Operand_bound, "rm32", 1<<3); -15 put_new(Operand_bound, "base", 1<<3); -16 put_new(Operand_bound, "index", 1<<3); -17 put_new(Operand_bound, "scale", 1<<2); -18 put_new(Operand_bound, "r32", 1<<3); -19 put_new(Operand_bound, "disp8", 1<<8); -20 put_new(Operand_bound, "disp16", 1<<16); +12 put_new(Operand_bound, "subop", 1<<3); +13 put_new(Operand_bound, "mod", 1<<2); +14 put_new(Operand_bound, "rm32", 1<<3); +15 put_new(Operand_bound, "base", 1<<3); +16 put_new(Operand_bound, "index", 1<<3); +17 put_new(Operand_bound, "scale", 1<<2); +18 put_new(Operand_bound, "r32", 1<<3); +19 put_new(Operand_bound, "disp8", 1<<8); +20 put_new(Operand_bound, "disp16", 1<<16); 21 // no bound needed for disp32 -22 put_new(Operand_bound, "imm8", 1<<8); +22 put_new(Operand_bound, "imm8", 1<<8); 23 // no bound needed for imm32 24 25 :(before "Pack Operands(segment code)") 26 check_operand_bounds(code); -27 if (trace_contains_errors()) return; +27 if (trace_contains_errors()) return; 28 :(code) 29 void check_operand_bounds(const segment& code) { -30 trace(99, "transform") << "-- check operand bounds" << end(); -31 for (int i = 0; i < SIZE(code.lines); ++i) { +30 trace(99, "transform") << "-- check operand bounds" << end(); +31 for (int i = 0; i < SIZE(code.lines); ++i) { 32 const line& inst = code.lines.at(i); -33 for (int j = first_operand(inst); j < SIZE(inst.words); ++j) +33 for (int j = first_operand(inst); j < SIZE(inst.words); ++j) 34 check_operand_bounds(inst.words.at(j)); -35 if (trace_contains_errors()) return; // stop at the first mal-formed instruction +35 if (trace_contains_errors()) return; // stop at the first mal-formed instruction 36 } 37 } 38 @@ -109,12 +109,12 @@ if ('onhashchange' in window) { 43 int32_t x = parse_int(w.data); 44 if (x >= 0) { 45 if (static_cast<uint32_t>(x) >= p->second) -46 raise << "'" << w.original << "' too large to fit in bitfield " << p->first << '\n' << end(); +46 raise << "'" << w.original << "' too large to fit in bitfield " << p->first << '\n' << end(); 47 } 48 else { 49 // hacky? assuming bound is a power of 2 50 if (x < -1*static_cast<int32_t>(p->second/2)) -51 raise << "'" << w.original << "' too large to fit in bitfield " << p->first << '\n' << end(); +51 raise << "'" << w.original << "' too large to fit in bitfield " << p->first << '\n' << end(); 52 } 53 } 54 } -- cgit 1.4.1-2-gfad0 6a41958afbdfcbb9e942'>b027e6c5 ^
e087f6d4
67b10f41 ^




4525eb4b ^
e087f6d4

d326f24d ^
c5fef0d4 ^

945e8eb6 ^
e087f6d4



e087f6d4



c7bfda90 ^
1fc1d8af ^





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165