mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-12-28 08:34:23 +03:00
Unsupported functions (nonceAppEval) should error immediately.
Original version was pushing error into generated TH, which was generating the error statement into the SSA formula; this breaks formula interpretation at compile time but hides the error. Instead, this changes it so that the error is thrown during TH evaluation.
This commit is contained in:
parent
1bceb8dc32
commit
0c67eddda8
@ -618,7 +618,7 @@ defaultNonceAppEvaluator bvi nonceApp =
|
||||
_ -> fail ("Unexpected arguments to read_mem: " ++ showF args)
|
||||
| otherwise ->
|
||||
case lookup fnName (A.locationFuncInterpretation (Proxy @arch)) of
|
||||
Nothing -> liftQ [| error ("Unsupported UF: " ++ show $(litE (StringL fnName))) |]
|
||||
Nothing -> error ("Unsupported UF: " ++ show fnName)
|
||||
Just fi -> do
|
||||
-- args is an assignment that contains elts; we could just generate
|
||||
-- expressions that evaluate each one and then splat them into new names
|
||||
@ -628,7 +628,7 @@ defaultNonceAppEvaluator bvi nonceApp =
|
||||
argNames -> do
|
||||
let call = appE (varE (A.exprInterpName fi)) $ foldr1 appE (map varE argNames)
|
||||
liftQ [| O.extractValue ($(call)) |]
|
||||
_ -> liftQ [| error "Unsupported NonceApp case" |]
|
||||
_ -> error "Unsupported NonceApp case"
|
||||
|
||||
-- | Parse the name of a memory read intrinsic and return the number of bytes
|
||||
-- that it reads. For example
|
||||
|
Loading…
Reference in New Issue
Block a user