Commit Graph

48 Commits

Author SHA1 Message Date
Paweł Bylica fb471ef3e7
loader: Standardize configuration syntax and add evmc_load_and_configure() 2019-06-27 13:43:51 +02:00
Paweł Bylica 45da8cfce8
loader: Use strcpy_sx() everywhere
Previously we used strcpy_s() standard library function on Windows, but it triggers some additional handlers in some cases. To have the same behavior use strcpy_sx() everywhere.
2019-06-27 13:39:43 +02:00
Paweł Bylica 81db59cede
loader: Make error_code in evmc_load_and_create() optional 2019-06-05 16:07:49 +02:00
Paweł Bylica 8c3b3e61e6
loader: Change strcpy_sx() to be limited version of strcpy_s()
The strcpy_sx() now reports errors and behaves as strcpy_s() when buffer is too small (nulls the buffer). But it does not have all the checks.
2019-05-31 08:15:17 +02:00
Paweł Bylica 5757da5859
loader: Expose strcpy_sx() for testing 2019-05-31 08:15:17 +02:00
Paweł Bylica 2de1f81c72
loader: Rename strcpy_s() implementation to strcpy_sx()
The implementation strcpy_s() in loader is wrong (to be fixed) and limited in comparison to strcpy_s() spec. Rename it to strcpy_sx() to indicate it is not the one from standard library.
2019-05-31 08:15:16 +02:00
Paweł Bylica 7b02081f2e
loader: Destroy VM with incompatible ABI
When a VM is loaded but turns out is has incompatible ABI version it should be destroyed before reporting the loading error and returning a null handle.

Fixes https://github.com/ethereum/evmc/issues/305
2019-05-30 14:21:04 +02:00
Paweł Bylica 39162766df
Update copyright year, include the years of files creation 2019-04-24 18:36:28 +02:00
Paweł Bylica 32af5f41ac
loader: Mark set_error() with format attribute 2019-04-24 15:02:57 +02:00
Paweł Bylica 4484a8b74a
loader: Add loading error messages 2019-04-24 15:02:56 +02:00
Paweł Bylica 51fe9f48d4
loader: Abstract and mock evmc_last_error_msg() 2019-04-24 15:02:56 +02:00
Paweł Bylica caf6c2a1bd
loader: Make evmc_last_error_msg() return error only once 2019-04-24 15:02:56 +02:00
Paweł Bylica 14c5356ae6
loader: Expose DLL load errors with evmc_last_error_msg()
Currently only works for errors by dlopen() on Linux and macos, otherwise returns NULL.
2019-04-16 18:06:54 +02:00
Paweł Bylica c0615047a3
CI: Remove redundant BUILD_SHARED_LIBS=ON 2019-03-14 18:33:36 +01:00
Paweł Bylica d8f09d1d11
test: Rewrite loader unit tests by mocking DLL loading 2019-03-13 22:07:13 +01:00
Paweł Bylica e3cf88cea1
loader: Change strcpy_s() availability check 2019-03-13 22:07:13 +01:00
Paweł Bylica ace9abdaf6
Rename Constantinople2 to Petersburg 2019-03-12 00:43:32 +01:00
Paweł Bylica b0ae85ebbf
Add C++ wrappers/bindings 2019-01-22 14:15:26 +01:00
Alex Beregszaszi cdc3f21dae
Reserve post-Constantinople EVM revision number as Constantinople2
Co-authored-by: Paweł Bylica <chfast@gmail.com>
2019-01-21 16:22:07 +01:00
Alex Beregszaszi f064fdcbd8 Add Istanbul to evmc_revision 2019-01-14 13:42:17 +00:00
Paweł Bylica a0bffe9523
Generalize loader searching algorithm
Allow loader to shorten the name word by word to the point where only single word is left.
2018-08-30 23:24:24 +02:00
Paweł Bylica a889442d6a
loader: Fix compilation on Windows with GCC 2018-08-30 11:09:00 +02:00
Paweł Bylica 044a137a36
Format code 2018-08-28 17:05:13 +02:00
Alex Beregszaszi b3959ec74b Fall back to evmc_create in the loader as a last resort 2018-08-25 16:30:53 +01:00
Paweł Bylica 43fc619a7e
Update license note in headers of source files 2018-08-22 13:57:25 +02:00
Paweł Bylica dc4ac2ad4f
Merge pull request #76 from ethereum/authors
Introduce AUTHORS file
2018-08-21 23:33:51 +02:00
Paweł Bylica 0659e24db0
Update copyright notice 2018-08-21 09:44:18 +02:00
Paweł Bylica 17fe768522
loader: Always build with PIC 2018-08-21 09:07:03 +02:00
Alex Beregszaszi 3fe4f28867 Add evmc_is_abi_compatible helper 2018-08-20 15:05:41 +01:00
Andrei Maiboroda 14b585922b
EXTCODEHASH support in instructions lib 2018-07-31 14:49:36 +02:00
Andrei Maiboroda 2e25d34c11
Support for EXTCODEHASH 2018-07-31 14:42:13 +02:00
Andrei Maiboroda cac4f6f9d0
CREATE2 support in instructions lib 2018-07-25 12:13:46 +02:00
Paweł Bylica 426ff28d89
CMake: Build static libs with fPIC when needed 2018-07-16 12:29:02 +02:00
Paweł Bylica edb29b7267
loader: Add helper to load and create a VM instance 2018-07-13 16:28:15 +02:00
Paweł Bylica 6b0ab05d07
loader: Fix support for Windows paths 2018-07-10 13:07:07 +02:00
Paweł Bylica 721f2b3083
loader: Return function pointer instead of EVM instance 2018-07-10 13:04:48 +02:00
Paweł Bylica 4a929e248a
loader: Add documentation 2018-07-10 13:03:15 +02:00
Paweł Bylica 49e26b1ede
loader: Add Windows support 2018-07-10 13:02:42 +02:00
Paweł Bylica 02b52e2926
Add evmc::loader library to support dynamic loading 2018-07-10 12:57:29 +02:00
Paweł Bylica 5372417ca6
Properly export symbols from DLLs 2018-06-25 18:48:03 +02:00
Paweł Bylica 08d5883dda
CMake: Change instructions output name to evmc-instructions 2018-06-19 22:30:36 +02:00
Paweł Bylica 4e91af62d3
CMake: Export CMake package config 2018-06-19 11:47:04 +02:00
Paweł Bylica cb9ebb7c82
Add names table for each EVM revision 2018-06-16 12:32:07 +02:00
Paweł Bylica 94bb5fbec9
Separate instruction names from metrics 2018-06-16 12:32:06 +02:00
Paweł Bylica 8a9ebd4966
Rename instructions.c to instruction_metrics.c 2018-06-16 12:32:06 +02:00
Paweł Bylica 2c83269f62
Set OP_EXP cost to HIGH 2018-06-16 12:32:06 +02:00
Paweł Bylica 765adc24bd
Add EVM instruction tables 2018-06-11 11:44:13 +02:00
Paweł Bylica d5ac5ce00e
CMake: Add config for evmc::instructions library 2018-06-07 12:25:10 +02:00