Browse Source

src/lib.rs: fix bytecode in some examples

Some doc examples have programs written in bytecode with assembly
instructions written in comments. Some of the "mov r0, 0" instructions
were not correct, fix them.

I just happened to notice those errors, I haven't run any particular
test to double check all instructions.
Quentin Monnet 6 năm trước cách đây
mục cha
commit
af2495e891
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      src/lib.rs

+ 3 - 3
src/lib.rs

@@ -133,7 +133,7 @@ impl<'a> EbpfVmMbuff<'a> {
     ///
     /// ```
     /// let prog1 = &[
-    ///     0xb7, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
+    ///     0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
     ///     0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  // exit
     /// ];
     /// let prog2 = &[
@@ -778,7 +778,7 @@ impl<'a> EbpfVmFixedMbuff<'a> {
     ///
     /// ```
     /// let prog1 = &[
-    ///     0xb7, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
+    ///     0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
     ///     0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  // exit
     /// ];
     /// let prog2 = &[
@@ -1069,7 +1069,7 @@ impl<'a> EbpfVmRaw<'a> {
     ///
     /// ```
     /// let prog1 = &[
-    ///     0xb7, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
+    ///     0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
     ///     0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  // exit
     /// ];
     /// let prog2 = &[