Skip to content

Commit 707e21e

Browse files
committed
Addressed reviewer comments
1 parent 61fb9d1 commit 707e21e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

intel-sgx/enclave-runner/src/loader.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,9 @@ impl<'a> EnclaveBuilder<'a> {
196196
return 0;
197197
}
198198

199-
let (base, size) = {
200-
let cpuid = cpuid(0x0d, bit);
201-
let base = cpuid.map_or(0, |c| c.ebx);
202-
203-
if base == 0 {
204-
(0, 0)
205-
} else {
206-
let size = cpuid.map_or(0, |c| c.eax);
207-
(base, size)
208-
}
199+
let CpuidResult { ebx: base, eax: size, .. } = match cpuid(0x0d, bit) {
200+
None | Some(CpuidResult { ebx: 0, .. }) => return 0,
201+
Some(v) => v,
209202
};
210203

211204
if max_ssaframesize_in_pages * 0x1000 < base + size {

0 commit comments

Comments
 (0)