Explorar el Código

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 hace 6 años
padre
commit
af2495e891
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  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 = &[