Make functions cloneable for testing.

It's not super fast to clone a function, but it is faster than
re-parsing the test case file it came from.

Some tests want to mutate the function, and there may be other tests in
the same script that need the original function.
This commit is contained in:
Jakob Stoklund Olesen
2016-09-15 08:41:19 -07:00
parent 2901a85a36
commit 6ffca9ec99
7 changed files with 17 additions and 8 deletions

View File

@@ -12,6 +12,7 @@ use std::fmt::{self, Display, Formatter};
///
/// All jump tables use 0-based indexing and are expected to be densely populated. They don't need
/// to be completely populated, though. Individual entries can be missing.
#[derive(Clone)]
pub struct JumpTableData {
// Table entries, using NO_EBB as a placeholder for missing entries.
table: Vec<Ebb>,