assignVar ::
  JVMCrucibleContext {- ^ context for interacting with Crucible -} ->
  W4.ProgramLoc ->
  AllocIndex {- ^ variable index -} ->
  JVMRefVal  {- ^ concrete value -} ->
  OverrideMatcher CJ.JVM w ()

assignVar cc loc var ref =
  do old <- OM (setupValueSub . at var <<.= Just ref)
     let sym = cc ^. jccSym
     for_ old $ \ref' ->
       do p <- liftIO (CJ.refIsEqual sym ref ref')
          addAssert p (Crucible.SimError loc (Crucible.AssertFailureSimError "equality of aliased pointers" ""))

------------------------------------------------------------------------
assignVar ::
  JVMCrucibleContext {- ^ context for interacting with Crucible -} ->
  W4.ProgramLoc ->
  AllocIndex {- ^ variable index -} ->
  JVMRefVal  {- ^ concrete value -} ->
  OverrideMatcher CJ.JVM w ()
assignVar cc loc var ref =
  do old <- OM (setupValueSub . at var <<.= Just ref)
     let sym = cc ^. jccSym
     for_ old $ \ref' ->
       do p <- liftIO (CJ.refIsEqual sym ref ref')
          addAssert p (Crucible.SimError loc (Crucible.AssertFailureSimError "equality of aliased pointers" ""))

------------------------------------------------------------------------
assignVar cc loc var ref =
  do old <- OM (setupValueSub . at var <<.= Just ref)
     let sym = cc ^. jccSym
     for_ old $ \ref' ->
       do p <- liftIO (CJ.refIsEqual sym ref ref')
          addAssert p (Crucible.SimError loc (Crucible.AssertFailureSimError "equality of aliased pointers" ""))

------------------------------------------------------------------------