script_opt/CPP: errors, recursive type fixes, fix embedded comments

better (than nothing) run-time errors for compiled scripts
fixes for dealing with recursive types in compiled scripts
fix for values in compiled scripts containing embedded comment markers
This commit is contained in:
Vern Paxson 2023-03-08 10:12:01 +01:00 committed by Arne Welzel
parent b7f7d32bf7
commit c0dd2b4e81
27 changed files with 181 additions and 65 deletions

View file

@ -551,7 +551,7 @@ void CPPCompile::GenForOverString(const ExprPtr& str, const IDPList* loop_vars)
{
Emit("auto sval__CPP = %s;", GenExpr(str, GEN_DONT_CARE));
Emit("for ( auto i__CPP = 0u; i__CPP < sval__CPP->Len(); ++i__CPP )");
Emit("for ( auto i__CPP = 0; i__CPP < sval__CPP->Len(); ++i__CPP )");
StartBlock();
Emit("auto sv__CPP = make_intrusive<StringVal>(1, (const char*) sval__CPP->Bytes() + i__CPP);");