Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow GenArchVals functions to indicate an error. #412

Open
kquick opened this issue Jul 26, 2024 · 0 comments
Open

Allow GenArchVals functions to indicate an error. #412

kquick opened this issue Jul 26, 2024 · 0 comments
Labels
symbolic-execution Issues relating to macaw-symbolic and symbolic execution

Comments

@kquick
Copy link
Member

kquick commented Jul 26, 2024

Currently, the lookupReg and updateReg function stored in GenArchValues are defined as pure functions, but it could legitimately return an error to the caller under certain conditions (e.g. being passed an invalid register value). This forces architecture-specific code to use error or panic (see the implementation for macaw-symbolic-riscv) and makes the code partial. While the API cannot enforce valid values on the client side, it should be able to throw the error back to the offending code rather than halting the program.

, updateReg
:: forall sym tp
. (SymArchConstraints arch, IsSymInterface sym)
=> C.RegEntry sym (CG.ArchRegStruct arch)
-> M.ArchReg arch tp
-> C.RegValue sym (PS.ToCrucibleType tp)
-> C.RegEntry sym (CG.ArchRegStruct arch)

@RyanGlScott RyanGlScott added the symbolic-execution Issues relating to macaw-symbolic and symbolic execution label Jul 26, 2024
RyanGlScott added a commit that referenced this issue Jul 26, 2024
…rror

See #412 for the remaining task of
allowing the return types of `GenArchVals`' `{lookup,update}Reg` functions to
indicate the possibility of an error.
RyanGlScott added a commit that referenced this issue Jul 26, 2024
…rror

See #412 for the remaining task of
allowing the return types of `GenArchVals`' `{lookup,update}Reg` functions to
indicate the possibility of an error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
symbolic-execution Issues relating to macaw-symbolic and symbolic execution
Projects
None yet
Development

No branches or pull requests

2 participants