Pull in solana_rbpf v0.1.14 (#5609)
This commit is contained in:
@ -58,18 +58,6 @@ static_assert(sizeof(uint64_t) == 8);
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Helper function that prints a string to stdout
|
||||
*/
|
||||
void sol_log(const char *);
|
||||
|
||||
/**
|
||||
* Helper function that prints a 64 bit values represented in hexadecimal
|
||||
* to stdout
|
||||
*/
|
||||
void sol_log_64(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t);
|
||||
|
||||
|
||||
/**
|
||||
* Prefix for all BPF functions
|
||||
*
|
||||
@ -78,6 +66,18 @@ void sol_log_64(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t);
|
||||
*/
|
||||
#define SOL_FN_PREFIX __attribute__((always_inline)) static
|
||||
|
||||
/**
|
||||
* Helper function that prints a string to stdout
|
||||
*/
|
||||
void sol_log_(const char *, uint64_t);
|
||||
#define sol_log(message) sol_log_(message, sol_strlen(message))
|
||||
|
||||
/**
|
||||
* Helper function that prints a 64 bit values represented in hexadecimal
|
||||
* to stdout
|
||||
*/
|
||||
void sol_log_64(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t);
|
||||
|
||||
/**
|
||||
* Size of Public key in bytes
|
||||
*/
|
||||
@ -175,8 +175,8 @@ SOL_FN_PREFIX size_t sol_strlen(const char *s) {
|
||||
* Prints the line number where the panic occurred and then causes
|
||||
* the BPF VM to immediately halt execution. No accounts' userdata are updated
|
||||
*/
|
||||
void sol_panic_(const char *, uint64_t, uint64_t);
|
||||
#define sol_panic() sol_panic_(__FILE__, __LINE__, 0)
|
||||
void sol_panic_(const char *, uint64_t, uint64_t, uint64_t);
|
||||
#define sol_panic() sol_panic_(__FILE__, sizeof(__FILE__), __LINE__, 0)
|
||||
|
||||
/**
|
||||
* Asserts
|
||||
@ -329,7 +329,7 @@ bool entrypoint(const uint8_t *input);
|
||||
* Stub log functions when building tests
|
||||
*/
|
||||
#include <stdio.h>
|
||||
void sol_log(const char *s) {
|
||||
void sol_log_(const char *s, uint64_t len) {
|
||||
printf("sol_log: %s\n", s);
|
||||
}
|
||||
void sol_log_64(uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5) {
|
||||
|
@ -5,7 +5,7 @@ use core::ptr;
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(info: &PanicInfo) -> ! {
|
||||
// Message is ignored for now to avoid incurring formatting program size overhead
|
||||
// Message is ignored for now to avoid incurring formatting overhead
|
||||
match info.location() {
|
||||
Some(location) => {
|
||||
let mut file: [u8; 128] = [0; 128];
|
||||
@ -18,14 +18,15 @@ fn panic(info: &PanicInfo) -> ! {
|
||||
unsafe {
|
||||
sol_panic_(
|
||||
file.as_ptr(),
|
||||
file.len() as u64,
|
||||
u64::from(location.line()),
|
||||
u64::from(location.column()),
|
||||
);
|
||||
}
|
||||
}
|
||||
None => unsafe { sol_panic_(ptr::null(), 0, 0) },
|
||||
None => unsafe { sol_panic_(ptr::null(), 0, 0, 0) },
|
||||
}
|
||||
}
|
||||
extern "C" {
|
||||
pub fn sol_panic_(file: *const u8, line: u64, column: u64) -> !;
|
||||
pub fn sol_panic_(file: *const u8, len: u64, line: u64, column: u64) -> !;
|
||||
}
|
||||
|
Reference in New Issue
Block a user