From df1df6f4771bb14cab454cf583ef0b060bab98cf Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Fri, 5 Jan 2024 12:18:07 -0800 Subject: [PATCH] Small updates to perserve legacy behavior A couple of small fixes that affect behavior of contracts (these showed up with pdo-contracts tests): * make the default for '/' in a json string not to be escaped, this shows up in json encoding of keys * add __cxa_pure_function implementation that is missing from WASI SDK Signed-off-by: Mic Bowman --- common/packages/parson/parson.cpp | 4 ++++ contracts/wawaka/common/Util.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/common/packages/parson/parson.cpp b/common/packages/parson/parson.cpp index c934670d..76aaa153 100644 --- a/common/packages/parson/parson.cpp +++ b/common/packages/parson/parson.cpp @@ -99,7 +99,11 @@ static JSON_Malloc_Function parson_malloc = malloc; static JSON_Free_Function parson_free = free; +#ifndef COMPILE_FOR_SGX static int parson_escape_slashes = 1; +#else +static int parson_escape_slashes = 0; +#endif static char *parson_float_format = NULL; diff --git a/contracts/wawaka/common/Util.cpp b/contracts/wawaka/common/Util.cpp index 5807cae5..698046a7 100644 --- a/contracts/wawaka/common/Util.cpp +++ b/contracts/wawaka/common/Util.cpp @@ -73,6 +73,12 @@ int vfprintf(FILE *__restrict, const char *__restrict, __isoc_va_list) return -1; } +extern "C" void __cxa_pure_virtual(void) +{ + CONTRACT_SAFE_LOG(4, "missing pure virtual function"); + std::abort(); +} + #endif /* ----------------------------------------------------------------- *