Skip to content
Browse files

Treat argv[1] as an m0 string instead of a C string

  • Loading branch information...
1 parent 827748e commit e6473c6fb8df4aa3fd1943d5a90b1791c3a44655 @nbrown nbrown committed with cotto
Showing with 2 additions and 4 deletions.
  1. +2 −4 t/m0/integration/m0_args.m0
View
6 t/m0/integration/m0_args.m0
@@ -87,14 +87,14 @@ string_cmp_loop:
# put number of characters remaining into I2
sub_i I2, I2, I1
- get_byte I3, S0, I2
# store S1[I2 + 8] in I4
# skip past the string header
set_imm I5, 0, 8
add_i I5, I2, I5
- # store the value of the current char in I4
+ # store the value of the current char in I4 and I3
get_byte I4, S1, I5
+ get_byte I3, S0, I5
# if i3 != i4 (the two characters from the string differ), fail
sub_i I3, I3, I4
@@ -104,8 +104,6 @@ string_cmp_loop:
goto_if string_cmp_loop, I2
goto argv_ok, x
- # TODO: test S0 eq 'kittens'
-
argv_nok:
set_imm S0, 0, 5
deref S0, CONSTS, S0

0 comments on commit e6473c6

Please sign in to comment.
Something went wrong with that request. Please try again.