From dc50ed69cf63c3610fd0c38a9010486679059a30 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 16 Nov 2019 11:33:04 +0300 Subject: [PATCH] bare: fix str[idx] --- vlib/builtin/bare/builtin_bare.v | 4 ++++ vlib/compiler/gen_c.v | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/vlib/builtin/bare/builtin_bare.v b/vlib/builtin/bare/builtin_bare.v index 1c074cf991..3857028576 100644 --- a/vlib/builtin/bare/builtin_bare.v +++ b/vlib/builtin/bare/builtin_bare.v @@ -7,3 +7,7 @@ pub fn panic(s string) { //write(1, s.str, s.len) } +pub fn panic_debug(s string) { + //write(1, s.str, s.len) +} + diff --git a/vlib/compiler/gen_c.v b/vlib/compiler/gen_c.v index eaf059e265..f17086d071 100644 --- a/vlib/compiler/gen_c.v +++ b/vlib/compiler/gen_c.v @@ -211,7 +211,7 @@ fn (p mut Parser) index_get(typ string, fn_ph int, cfg IndexConfig) { } } } - else if cfg.is_str && !p.builtin_mod { + else if cfg.is_str && !p.builtin_mod && !p.pref.is_bare { if cfg.is_slice { p.gen('string_substr2($index_expr)') } else {